2009-06-12 18:00:04 +00:00
|
|
|
require File.join(File.dirname(__FILE__),'test_helper')
|
|
|
|
require 'fileutils'
|
|
|
|
require 'compass'
|
|
|
|
require 'compass/exec'
|
|
|
|
require 'timeout'
|
|
|
|
|
|
|
|
class RailsIntegrationTest < Test::Unit::TestCase
|
|
|
|
include Compass::TestCaseHelper
|
|
|
|
include Compass::CommandLineHelper
|
2009-08-25 21:18:58 +00:00
|
|
|
include Compass::IoHelper
|
2009-10-26 03:15:31 +00:00
|
|
|
include Compass::RailsHelper
|
2009-06-12 18:00:04 +00:00
|
|
|
|
|
|
|
def setup
|
2009-08-25 21:18:58 +00:00
|
|
|
Compass.reset_configuration!
|
2009-06-12 18:00:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_rails_install
|
|
|
|
within_tmp_directory do
|
2009-06-20 17:33:47 +00:00
|
|
|
generate_rails_app_directories("compass_rails")
|
2009-06-12 18:00:04 +00:00
|
|
|
Dir.chdir "compass_rails" do
|
|
|
|
compass("--rails", '--trace', ".") do |responder|
|
2009-09-02 00:22:26 +00:00
|
|
|
responder.respond_to "Is this OK? (Y/n)", :with => "Y", :required => true
|
|
|
|
responder.respond_to "Emit compiled stylesheets to public/stylesheets/compiled/? (Y/n)", :with => "Y", :required => true
|
2009-06-12 18:00:04 +00:00
|
|
|
end
|
|
|
|
# puts ">>>#{@last_result}<<<"
|
|
|
|
assert_action_performed :create, "./app/stylesheets/screen.sass"
|
|
|
|
assert_action_performed :create, "./config/initializers/compass.rb"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
puts "Skipping rails test. Couldn't Load rails"
|
|
|
|
end
|
|
|
|
|
2009-06-20 17:33:47 +00:00
|
|
|
def test_rails_install_with_no_dialog
|
|
|
|
within_tmp_directory do
|
|
|
|
generate_rails_app_directories("compass_rails")
|
|
|
|
Dir.chdir "compass_rails" do
|
|
|
|
compass(*%w(--rails --trace --sass-dir app/stylesheets --css-dir public/stylesheets/compiled .))
|
|
|
|
assert_action_performed :create, "./app/stylesheets/screen.sass"
|
|
|
|
assert_action_performed :create, "./config/initializers/compass.rb"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
puts "Skipping rails test. Couldn't Load rails"
|
|
|
|
end
|
2009-10-26 03:15:31 +00:00
|
|
|
end
|