From 8fc0c48dd5e5396068f2663975616adb444fd555 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 19 Jan 2009 11:04:25 -0800 Subject: [PATCH] Unit test for the compass rails installer. --- test/command_line_test.rb | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/test/command_line_test.rb b/test/command_line_test.rb index 779d809f..cf148f89 100644 --- a/test/command_line_test.rb +++ b/test/command_line_test.rb @@ -43,16 +43,23 @@ class CommandLineTest < Test::Unit::TestCase end end - # def test_rails_install - # within_tmp_directory do - # generate_rails_app("compass_rails") - # Dir.chdir "compass_rails" do - # compass "--rails" - # end - # end - # rescue LoadError - # puts "Skipping rails test. Couldn't Load rails" - # end + def test_rails_install + within_tmp_directory do + generate_rails_app("compass_rails") + Dir.chdir "compass_rails" do + compass "--rails" do |responder| + responder.respond_to "Is this OK? (Y/n) ", :with => "Y" + responder.respond_to "Emit compiled stylesheets to public/stylesheets/compiled? (Y/n) ", :with => "Y" + end + # puts @last_result + assert_action_performed :create, "app/stylesheets/screen.sass" + assert_action_performed :create, "config/initializers/compass.rb" + assert_action_performed :create, "app/views/layouts/application.html.haml" + end + end + rescue LoadError + puts "Skipping rails test. Couldn't Load rails" + end protected def compass(*arguments) @@ -130,7 +137,7 @@ class CommandLineTest < Test::Unit::TestCase Compass::Exec::Compass.new(arguments).run! end - # def generate_rails_app(name) - # `rails #{name}` - # end + def generate_rails_app(name) + `rails #{name}` + end end \ No newline at end of file