Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit f765210

Browse files
committed
compass compile tested in version 3.0 - 3.2
1 parent 0239c57 commit f765210

10 files changed

+50
-18
lines changed

Appraisals

+2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ end
88

99
appraise "rails31" do
1010
gem "rails", "3.1.3"
11+
gem "sass-rails"
1112
end
1213

1314
appraise "rails32" do
1415
gem "rails", "~> 3.2"
16+
gem "sass-rails"
1517
end

compass-rails.gemspec

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Gem::Specification.new do |gem|
1515
gem.require_paths = ["lib"]
1616
gem.version = Compass::Rails::VERSION
1717

18-
1918
gem.add_dependency 'compass', '~> 0.12.alpha'
2019

2120
end

gemfiles/rails31.gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ gem "ruby_gntp", :require=>false
88
gem "guard"
99
gem "guard-test"
1010
gem "rails", "3.1.3"
11+
gem "sass-rails"
1112

1213
gemspec :path=>"../"

gemfiles/rails32.gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ gem "ruby_gntp", :require=>false
88
gem "guard"
99
gem "guard-test"
1010
gem "rails", "~> 3.2"
11+
gem "sass-rails"
1112

1213
gemspec :path=>"../"

lib/compass-rails.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def load_rails
2020
end
2121
#load the rails config
2222
require "#{rails_config_path}/config/application.rb"
23-
require 'sass-rails'
23+
require 'sass-rails' unless rails3? || rails2?
2424
end
2525

2626
def context

test/helpers/command_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def run_command(command, gemfile=nil)
4747
capture_all_output { CompassRails::Test::CommandRunner.new(command, gemfile).run }
4848
end
4949

50-
def bundle
51-
run_command(BUNDLER_COMMAND)
50+
def bundle(gemfile=nil)
51+
run_command(BUNDLER_COMMAND, gemfile)
5252
end
5353

5454
end

test/helpers/rails_project.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def run_compass(command)
150150
unless File.exist?(directory.join(GEMFILE_LOCK))
151151
bundle
152152
end
153-
run_command("compass #{command}", directory.join(GEMFILE))
153+
run_command("compass #{command}", GEMFILES[version])
154154
end
155155

156156
def set_compass(property, value)
@@ -210,9 +210,7 @@ def load_gems
210210
end
211211

212212
def bundle!
213-
capture_output do
214-
`bundle install`
215-
end
213+
bundle(directory.join(GEMFILE).to_s)
216214
end
217215

218216
def has_gem?(name)
@@ -225,6 +223,7 @@ def install_gem(name, requirements=nil)
225223

226224
def install_compass_gem
227225
install_gem('compass', "'~> 0.12.alpha'")
226+
install_gem('compass-rails', ":path =>'#{File.expand_path('../../../', __FILE__)}'")
228227
end
229228

230229
private

test/integrations/rails3_test.rb

+10
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,15 @@ def test_generator_installs_compass
2121
end
2222
end
2323

24+
def test_compass_compile
25+
within_rails_app('test_railtie', RAILS_3) do |project|
26+
project.install_compass
27+
project.bundle!
28+
project.generate('compass_rails:install')
29+
project.run_compass('compile')
30+
assert project.directory.join('public/stylesheets/screen.css').exist?
31+
end
32+
end
33+
2434

2535
end

test/integrations/rails_31_test.rb

+18-8
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,31 @@ def test_rails_app_created
66
within_rails_app('test_railtie', RAILS_3_1) do |project|
77
project.install_compass
88
assert project.has_gem? 'compass'
9-
project.bundle
9+
project.bundle!
1010
assert project.rails3?
1111
assert project.boots?
1212
assert project.has_generator?('compass_rails')
1313
end
1414
end
1515

1616
def test_generator_installs_compass
17-
within_rails_app('test_railtie', RAILS_3_1) do |project|
18-
project.install_compass
19-
project.bundle
20-
project.generate('compass_rails:install')
21-
assert project.has_screen_file?
22-
assert project.has_compass_import?
17+
within_rails_app('test_railtie', RAILS_3_1) do |project|
18+
project.install_compass
19+
project.bundle!
20+
project.generate('compass_rails:install')
21+
assert project.has_screen_file?
22+
assert project.has_compass_import?
23+
end
24+
end
25+
26+
def test_compass_compile
27+
within_rails_app('test_railtie', RAILS_3_1) do |project|
28+
project.install_compass
29+
project.bundle!
30+
project.generate('compass_rails:install')
31+
project.run_compass('compile')
32+
assert project.directory.join('public/assets/screen.css').exist?
33+
end
2334
end
24-
end
2535

2636
end

test/integrations/rails_32_test.rb

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ def test_rails_app_created
66
within_rails_app('test_railtie', RAILS_3_2) do |project|
77
project.install_compass
88
assert project.has_gem? 'compass'
9-
project.bundle
9+
assert project.has_gem? 'compass-rails'
10+
project.bundle!
1011
assert project.rails3?
1112
assert project.boots?
1213
assert project.has_generator?('compass_rails')
@@ -17,12 +18,21 @@ def test_rails_app_created
1718
def test_generator_installs_compass
1819
within_rails_app('test_railtie', RAILS_3_2) do |project|
1920
project.install_compass
20-
project.bundle
21+
project.bundle!
2122
project.generate('compass_rails:install')
2223
assert project.has_screen_file?
2324
assert project.has_compass_import?
2425
end
2526
end
2627

28+
def test_compass_compile
29+
within_rails_app('test_railtie', RAILS_3_2) do |project|
30+
project.install_compass
31+
project.bundle!
32+
project.generate('compass_rails:install')
33+
project.run_compass('compile')
34+
assert project.directory.join('public/assets/screen.css').exist?
35+
end
36+
end
2737

2838
end

0 commit comments

Comments
 (0)