Fix failing tests due to load path changes.
This commit is contained in:
parent
a997fa2332
commit
85268281bc
2
Gemfile
2
Gemfile
@ -8,7 +8,7 @@ gem "rspec", "~>2.0.0"
|
|||||||
gem "rails", "~>3.0.0.rc"
|
gem "rails", "~>3.0.0.rc"
|
||||||
gem "compass-validator", "3.0.0"
|
gem "compass-validator", "3.0.0"
|
||||||
gem "css_parser", "~> 1.0.1"
|
gem "css_parser", "~> 1.0.1"
|
||||||
gem "sass", "3.1.0.alpha.249"
|
gem "sass", "3.1.0.alpha.263"
|
||||||
gem "haml", "~> 3.1.0.alpha"
|
gem "haml", "~> 3.1.0.alpha"
|
||||||
gem "rcov"
|
gem "rcov"
|
||||||
gem "rubyzip"
|
gem "rubyzip"
|
||||||
|
@ -7,7 +7,7 @@ GIT
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
compass (0.11.beta.7.613753e)
|
compass (0.11.beta.7.a997fa2)
|
||||||
chunky_png (~> 1.1.1)
|
chunky_png (~> 1.1.1)
|
||||||
fssm (>= 0.2.7)
|
fssm (>= 0.2.7)
|
||||||
sass (>= 3.1.0.alpha.249)
|
sass (>= 3.1.0.alpha.249)
|
||||||
@ -118,7 +118,7 @@ GEM
|
|||||||
ruby-json (1.1.2)
|
ruby-json (1.1.2)
|
||||||
ruby-prof (0.10.5)
|
ruby-prof (0.10.5)
|
||||||
rubyzip (0.9.4)
|
rubyzip (0.9.4)
|
||||||
sass (3.1.0.alpha.249)
|
sass (3.1.0.alpha.263)
|
||||||
term-ansicolor (1.0.5)
|
term-ansicolor (1.0.5)
|
||||||
thor (0.14.6)
|
thor (0.14.6)
|
||||||
timecop (0.3.5)
|
timecop (0.3.5)
|
||||||
@ -145,5 +145,5 @@ DEPENDENCIES
|
|||||||
rspec (~> 2.0.0)
|
rspec (~> 2.0.0)
|
||||||
ruby-prof
|
ruby-prof
|
||||||
rubyzip
|
rubyzip
|
||||||
sass (= 3.1.0.alpha.249)
|
sass (= 3.1.0.alpha.263)
|
||||||
timecop
|
timecop
|
||||||
|
@ -87,10 +87,16 @@ class ConfigurationTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
Compass.add_configuration(contents, "test_additional_import_paths")
|
Compass.add_configuration(contents, "test_additional_import_paths")
|
||||||
|
|
||||||
assert Compass.configuration.to_sass_engine_options[:load_paths].include?("/home/chris/my_compass_project/../foo")
|
engine_opts = Compass.configuration.to_sass_engine_options
|
||||||
assert Compass.configuration.to_sass_engine_options[:load_paths].include?("/path/to/my/framework"), Compass.configuration.to_sass_engine_options[:load_paths].inspect
|
|
||||||
assert_equal "/home/chris/my_compass_project/css/framework", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/path/to/my/framework"}[1]
|
load_paths = load_paths_as_strings(engine_opts[:load_paths])
|
||||||
assert_equal "/home/chris/my_compass_project/css/foo", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/home/chris/my_compass_project/../foo"}[1]
|
|
||||||
|
plugin_opts = Compass.configuration.to_sass_plugin_options
|
||||||
|
|
||||||
|
assert load_paths.include?("/home/chris/my_compass_project/../foo")
|
||||||
|
assert load_paths.include?("/path/to/my/framework"), load_paths.inspect
|
||||||
|
assert_equal "/home/chris/my_compass_project/css/framework", plugin_opts[:template_location].find{|s,c| s == "/path/to/my/framework"}[1]
|
||||||
|
assert_equal "/home/chris/my_compass_project/css/foo", plugin_opts[:template_location].find{|s,c| s == "/home/chris/my_compass_project/../foo"}[1]
|
||||||
|
|
||||||
expected_serialization = <<EXPECTED
|
expected_serialization = <<EXPECTED
|
||||||
# Require any additional compass plugins here.
|
# Require any additional compass plugins here.
|
||||||
@ -121,8 +127,10 @@ EXPECTED
|
|||||||
|
|
||||||
Compass.add_configuration(contents, "test_additional_import_paths")
|
Compass.add_configuration(contents, "test_additional_import_paths")
|
||||||
|
|
||||||
assert Compass.configuration.to_sass_engine_options[:load_paths].include?("/home/chris/my_compass_project/../foo")
|
load_paths = load_paths_as_strings(Compass.configuration.to_sass_engine_options[:load_paths])
|
||||||
assert Compass.configuration.to_sass_engine_options[:load_paths].include?("/path/to/my/framework"), Compass.configuration.to_sass_engine_options[:load_paths].inspect
|
|
||||||
|
assert load_paths.include?("/home/chris/my_compass_project/../foo")
|
||||||
|
assert load_paths.include?("/path/to/my/framework"), load_paths.inspect
|
||||||
assert_equal "/home/chris/my_compass_project/css/framework", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/path/to/my/framework"}[1]
|
assert_equal "/home/chris/my_compass_project/css/framework", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/path/to/my/framework"}[1]
|
||||||
assert_equal "/home/chris/my_compass_project/css/foo", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/home/chris/my_compass_project/../foo"}[1]
|
assert_equal "/home/chris/my_compass_project/css/foo", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/home/chris/my_compass_project/../foo"}[1]
|
||||||
|
|
||||||
@ -235,4 +243,17 @@ EXPECTED
|
|||||||
ensure
|
ensure
|
||||||
Compass::Configuration.remove_configuration_property :foobar
|
Compass::Configuration.remove_configuration_property :foobar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def load_paths_as_strings(load_paths)
|
||||||
|
load_paths.map do |path|
|
||||||
|
case path
|
||||||
|
when Sass::Importers::Filesystem
|
||||||
|
path.root
|
||||||
|
when String, Pathname
|
||||||
|
path.to_s
|
||||||
|
end
|
||||||
|
end.compact
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user