Permalink
Browse files

compass compile tested in version 3.0 - 3.2

  • Loading branch information...
1 parent 0239c57 commit f7652108ab7eeb6ff9c789a21f474c5b0a62f392 @scottdavis scottdavis committed Jan 28, 2012
View
@@ -8,8 +8,10 @@ end
appraise "rails31" do
gem "rails", "3.1.3"
+ gem "sass-rails"
end
appraise "rails32" do
gem "rails", "~> 3.2"
+ gem "sass-rails"
end
@@ -15,7 +15,6 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = Compass::Rails::VERSION
-
gem.add_dependency 'compass', '~> 0.12.alpha'
end
@@ -8,5 +8,6 @@ gem "ruby_gntp", :require=>false
gem "guard"
gem "guard-test"
gem "rails", "3.1.3"
+gem "sass-rails"
gemspec :path=>"../"
@@ -8,5 +8,6 @@ gem "ruby_gntp", :require=>false
gem "guard"
gem "guard-test"
gem "rails", "~> 3.2"
+gem "sass-rails"
gemspec :path=>"../"
@@ -20,7 +20,7 @@ def load_rails
end
#load the rails config
require "#{rails_config_path}/config/application.rb"
- require 'sass-rails'
+ require 'sass-rails' unless rails3? || rails2?
end
def context
@@ -47,8 +47,8 @@ def run_command(command, gemfile=nil)
capture_all_output { CompassRails::Test::CommandRunner.new(command, gemfile).run }
end
- def bundle
- run_command(BUNDLER_COMMAND)
+ def bundle(gemfile=nil)
+ run_command(BUNDLER_COMMAND, gemfile)
end
end
@@ -150,7 +150,7 @@ def run_compass(command)
unless File.exist?(directory.join(GEMFILE_LOCK))
bundle
end
- run_command("compass #{command}", directory.join(GEMFILE))
+ run_command("compass #{command}", GEMFILES[version])
end
def set_compass(property, value)
@@ -210,9 +210,7 @@ def load_gems
end
def bundle!
- capture_output do
- `bundle install`
- end
+ bundle(directory.join(GEMFILE).to_s)
end
def has_gem?(name)
@@ -225,6 +223,7 @@ def install_gem(name, requirements=nil)
def install_compass_gem
install_gem('compass', "'~> 0.12.alpha'")
+ install_gem('compass-rails', ":path =>'#{File.expand_path('../../../', __FILE__)}'")
end
private
@@ -21,5 +21,15 @@ def test_generator_installs_compass
end
end
+ def test_compass_compile
+ within_rails_app('test_railtie', RAILS_3) do |project|
+ project.install_compass
+ project.bundle!
+ project.generate('compass_rails:install')
+ project.run_compass('compile')
+ assert project.directory.join('public/stylesheets/screen.css').exist?
+ end
+ end
+
end
@@ -6,21 +6,31 @@ def test_rails_app_created
within_rails_app('test_railtie', RAILS_3_1) do |project|
project.install_compass
assert project.has_gem? 'compass'
- project.bundle
+ project.bundle!
assert project.rails3?
assert project.boots?
assert project.has_generator?('compass_rails')
end
end
def test_generator_installs_compass
- within_rails_app('test_railtie', RAILS_3_1) do |project|
- project.install_compass
- project.bundle
- project.generate('compass_rails:install')
- assert project.has_screen_file?
- assert project.has_compass_import?
+ within_rails_app('test_railtie', RAILS_3_1) do |project|
+ project.install_compass
+ project.bundle!
+ project.generate('compass_rails:install')
+ assert project.has_screen_file?
+ assert project.has_compass_import?
+ end
+ end
+
+ def test_compass_compile
+ within_rails_app('test_railtie', RAILS_3_1) do |project|
+ project.install_compass
+ project.bundle!
+ project.generate('compass_rails:install')
+ project.run_compass('compile')
+ assert project.directory.join('public/assets/screen.css').exist?
+ end
end
-end
end
@@ -6,7 +6,8 @@ def test_rails_app_created
within_rails_app('test_railtie', RAILS_3_2) do |project|
project.install_compass
assert project.has_gem? 'compass'
- project.bundle
+ assert project.has_gem? 'compass-rails'
+ project.bundle!
assert project.rails3?
assert project.boots?
assert project.has_generator?('compass_rails')
@@ -17,12 +18,21 @@ def test_rails_app_created
def test_generator_installs_compass
within_rails_app('test_railtie', RAILS_3_2) do |project|
project.install_compass
- project.bundle
+ project.bundle!
project.generate('compass_rails:install')
assert project.has_screen_file?
assert project.has_compass_import?
end
end
+def test_compass_compile
+ within_rails_app('test_railtie', RAILS_3_2) do |project|
+ project.install_compass
+ project.bundle!
+ project.generate('compass_rails:install')
+ project.run_compass('compile')
+ assert project.directory.join('public/assets/screen.css').exist?
+ end
+end
end

0 comments on commit f765210

Please sign in to comment.