2009-11-19 10:26:35 +00:00
|
|
|
require 'test_helper'
|
2009-02-13 07:08:57 +00:00
|
|
|
require 'compass'
|
2009-08-25 21:18:58 +00:00
|
|
|
require 'stringio'
|
2009-02-13 07:08:57 +00:00
|
|
|
|
|
|
|
class ConfigurationTest < Test::Unit::TestCase
|
2009-05-08 15:08:26 +00:00
|
|
|
|
2011-04-28 03:18:52 +00:00
|
|
|
setup do
|
|
|
|
Compass.reset_configuration!
|
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
2009-08-25 21:18:58 +00:00
|
|
|
Compass.reset_configuration!
|
2009-05-08 15:11:42 +00:00
|
|
|
end
|
|
|
|
|
2009-02-13 07:08:57 +00:00
|
|
|
def test_parse_and_serialize
|
2009-08-25 21:18:58 +00:00
|
|
|
contents = StringIO.new(<<-CONFIG)
|
2009-02-13 07:08:57 +00:00
|
|
|
require 'compass'
|
2009-02-21 01:11:22 +00:00
|
|
|
# Require any additional compass plugins here.
|
2009-02-13 07:08:57 +00:00
|
|
|
|
2009-05-08 15:08:26 +00:00
|
|
|
project_type = :stand_alone
|
2011-04-28 03:18:52 +00:00
|
|
|
|
2009-11-28 01:10:48 +00:00
|
|
|
http_path = "/"
|
2009-02-13 07:08:57 +00:00
|
|
|
css_dir = "css"
|
|
|
|
sass_dir = "sass"
|
|
|
|
images_dir = "img"
|
|
|
|
javascripts_dir = "js"
|
2011-04-28 03:18:52 +00:00
|
|
|
|
2009-05-08 15:08:26 +00:00
|
|
|
output_style = :nested
|
2011-04-28 03:18:52 +00:00
|
|
|
|
2009-07-04 01:42:16 +00:00
|
|
|
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
|
|
# relative_assets = true
|
2011-04-28 03:18:52 +00:00
|
|
|
|
2010-10-31 04:59:38 +00:00
|
|
|
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
|
|
# line_comments = false
|
|
|
|
|
2011-04-28 03:18:52 +00:00
|
|
|
|
2010-10-31 04:59:38 +00:00
|
|
|
# If you prefer the indented syntax, you might want to regenerate this
|
|
|
|
# project again passing --syntax sass, or you can uncomment this:
|
|
|
|
# preferred_syntax = :sass
|
|
|
|
# and then run:
|
|
|
|
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
2009-02-13 07:08:57 +00:00
|
|
|
CONFIG
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
Compass.add_configuration(contents, "test_parse")
|
2009-02-13 07:08:57 +00:00
|
|
|
|
|
|
|
assert_equal 'sass', Compass.configuration.sass_dir
|
|
|
|
assert_equal 'css', Compass.configuration.css_dir
|
|
|
|
assert_equal 'img', Compass.configuration.images_dir
|
|
|
|
assert_equal 'js', Compass.configuration.javascripts_dir
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
expected_lines = contents.string.split("\n").map{|l|l.strip}
|
2009-02-13 07:08:57 +00:00
|
|
|
actual_lines = Compass.configuration.serialize.split("\n").map{|l|l.strip}
|
2011-04-28 03:18:52 +00:00
|
|
|
assert_correct expected_lines, actual_lines
|
2009-02-13 07:08:57 +00:00
|
|
|
end
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
def test_serialization_warns_with_asset_host_set
|
|
|
|
contents = StringIO.new(<<-CONFIG)
|
2009-06-27 18:28:16 +00:00
|
|
|
asset_host do |path|
|
|
|
|
"http://example.com"
|
|
|
|
end
|
|
|
|
CONFIG
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
Compass.add_configuration(contents, "test_serialization_warns_with_asset_host_set")
|
2009-06-27 18:28:16 +00:00
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
warning = capture_warning do
|
2009-06-27 18:28:16 +00:00
|
|
|
Compass.configuration.serialize
|
|
|
|
end
|
2009-08-25 21:18:58 +00:00
|
|
|
assert_equal "WARNING: asset_host is code and cannot be written to a file. You'll need to copy it yourself.\n", warning
|
2009-06-27 18:28:16 +00:00
|
|
|
end
|
|
|
|
|
2012-01-29 21:06:57 +00:00
|
|
|
class TestData < Compass::Configuration::Data
|
|
|
|
def initialize
|
|
|
|
super(:test)
|
|
|
|
end
|
|
|
|
inherited_array :stuff
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_inherited_array_can_clobber
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.stuff = [:b]
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
assert_equal [:b], data2.stuff.to_a
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_inherited_array_can_append
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.stuff << :b
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
assert_equal [:b, :a], data2.stuff.to_a
|
|
|
|
end
|
|
|
|
|
2012-01-31 00:22:26 +00:00
|
|
|
def test_inherited_array_can_append_2
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.stuff << :b
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
data3 = TestData.new
|
|
|
|
data3.stuff << :c
|
|
|
|
data3.inherit_from!(data2)
|
|
|
|
assert_equal [:c, :b, :a], data3.stuff.to_a
|
|
|
|
end
|
|
|
|
|
2012-01-29 21:06:57 +00:00
|
|
|
def test_inherited_array_can_remove
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.stuff >> :a
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
assert_equal [], data2.stuff.to_a
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_inherited_array_combined_augmentations
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.stuff >> :a
|
|
|
|
data2.stuff << :b
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
assert_equal [:b], data2.stuff.to_a
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_inherited_array_long_methods
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.remove_from_stuff(:a)
|
|
|
|
data2.add_to_stuff(:b)
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
assert_equal [:b], data2.stuff.to_a
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_inherited_array_augmentations_can_be_clobbered
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.stuff >> :a
|
|
|
|
data2.stuff << :b
|
|
|
|
data2.stuff = [:c]
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
assert_equal [:c], data2.stuff.to_a
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_inherited_array_augmentations_after_clobbering
|
|
|
|
data1 = TestData.new
|
|
|
|
data1.stuff = [:a]
|
|
|
|
data2 = TestData.new
|
|
|
|
data2.stuff >> :a
|
|
|
|
data2.stuff << :b
|
|
|
|
data2.stuff = [:c, :d]
|
|
|
|
data2.stuff << :e
|
|
|
|
data2.stuff >> :c
|
|
|
|
data2.inherit_from!(data1)
|
|
|
|
assert_equal [:d, :e], data2.stuff.to_a
|
|
|
|
end
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
def test_serialization_warns_with_asset_cache_buster_set
|
|
|
|
contents = StringIO.new(<<-CONFIG)
|
2009-06-27 18:28:16 +00:00
|
|
|
asset_cache_buster do |path|
|
|
|
|
"http://example.com"
|
|
|
|
end
|
|
|
|
CONFIG
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
Compass.add_configuration(contents, "test_serialization_warns_with_asset_cache_buster_set")
|
2009-06-27 18:28:16 +00:00
|
|
|
|
2012-01-29 21:06:57 +00:00
|
|
|
assert_kind_of Proc, Compass.configuration.asset_cache_buster_without_default
|
|
|
|
assert_equal "http://example.com", Compass.configuration.asset_cache_buster_without_default.call("whatever")
|
2009-08-25 21:18:58 +00:00
|
|
|
warning = capture_warning do
|
2009-06-27 18:28:16 +00:00
|
|
|
Compass.configuration.serialize
|
|
|
|
end
|
2009-08-25 21:18:58 +00:00
|
|
|
assert_equal "WARNING: asset_cache_buster is code and cannot be written to a file. You'll need to copy it yourself.\n", warning
|
2009-06-27 18:28:16 +00:00
|
|
|
end
|
|
|
|
|
2012-01-29 21:06:57 +00:00
|
|
|
def test_inherited_arrays_augmentations_serialize
|
|
|
|
inherited = TestData.new
|
|
|
|
inherited.stuff << :a
|
|
|
|
d = TestData.new
|
|
|
|
d.stuff << :b
|
|
|
|
d.stuff >> :c
|
|
|
|
assert_equal <<CONFIG, d.serialize_property(:stuff, d.stuff)
|
|
|
|
stuff << :b
|
|
|
|
stuff >> :c
|
|
|
|
CONFIG
|
|
|
|
end
|
|
|
|
def test_inherited_arrays_clobbering_with_augmentations_serialize
|
|
|
|
inherited = TestData.new
|
|
|
|
inherited.stuff << :a
|
|
|
|
d = TestData.new
|
|
|
|
d.stuff << :b
|
|
|
|
d.stuff = [:c, :d]
|
|
|
|
d.stuff << :e
|
|
|
|
assert_equal <<CONFIG, d.serialize_property(:stuff, d.stuff)
|
|
|
|
stuff = [:c, :d, :e]
|
|
|
|
CONFIG
|
|
|
|
end
|
2009-06-27 19:15:28 +00:00
|
|
|
def test_additional_import_paths
|
2009-08-25 21:18:58 +00:00
|
|
|
contents = StringIO.new(<<-CONFIG)
|
2009-07-04 01:45:19 +00:00
|
|
|
http_path = "/"
|
2009-06-27 19:15:28 +00:00
|
|
|
project_path = "/home/chris/my_compass_project"
|
|
|
|
css_dir = "css"
|
|
|
|
additional_import_paths = ["../foo"]
|
|
|
|
add_import_path "/path/to/my/framework"
|
|
|
|
CONFIG
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
Compass.add_configuration(contents, "test_additional_import_paths")
|
2009-06-27 19:15:28 +00:00
|
|
|
|
2011-04-24 23:41:56 +00:00
|
|
|
engine_opts = Compass.configuration.to_sass_engine_options
|
|
|
|
|
|
|
|
load_paths = load_paths_as_strings(engine_opts[:load_paths])
|
|
|
|
|
|
|
|
plugin_opts = Compass.configuration.to_sass_plugin_options
|
|
|
|
|
2011-07-19 15:33:11 +00:00
|
|
|
assert load_paths.include?("/home/chris/foo"), "Expected to find /home/chris/foo in #{load_paths.inspect}"
|
2011-04-24 23:41:56 +00:00
|
|
|
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]
|
2011-07-19 18:44:14 +00:00
|
|
|
|
|
|
|
expected_serialization = <<EXPECTED
|
|
|
|
# Require any additional compass plugins here.
|
|
|
|
project_path = "/home/chris/my_compass_project"
|
|
|
|
|
|
|
|
http_path = "/"
|
|
|
|
css_dir = "css"
|
|
|
|
|
|
|
|
# You can select your preferred output style here (can be overridden via the command line):
|
|
|
|
# output_style = :expanded or :nested or :compact or :compressed
|
|
|
|
|
|
|
|
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
|
|
# relative_assets = true
|
|
|
|
additional_import_paths = ["../foo", "/path/to/my/framework"]
|
|
|
|
|
|
|
|
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
|
|
# line_comments = false
|
|
|
|
EXPECTED
|
2010-02-20 21:06:29 +00:00
|
|
|
assert_equal "/", Compass.configuration.http_path
|
2011-07-19 18:44:14 +00:00
|
|
|
assert_correct expected_serialization.split("\n"), Compass.configuration.serialize.split("\n")
|
2010-02-20 21:06:29 +00:00
|
|
|
end
|
|
|
|
|
2012-03-18 20:09:24 +00:00
|
|
|
def test_additional_import_paths_can_be_importers
|
|
|
|
contents = StringIO.new(<<-CONFIG)
|
|
|
|
http_path = "/"
|
|
|
|
project_path = "/home/chris/my_compass_project"
|
|
|
|
css_dir = "css"
|
|
|
|
additional_import_paths = ["../foo"]
|
|
|
|
add_import_path Sass::Importers::Filesystem.new("/tmp/foo")
|
|
|
|
CONFIG
|
|
|
|
|
|
|
|
Compass.add_configuration(contents, "test_additional_import_paths")
|
|
|
|
|
|
|
|
assert Compass.configuration.sass_load_paths.find{|p| p.is_a?(Sass::Importers::Filesystem) && p.root == "/tmp/foo"}
|
|
|
|
assert Compass.configuration.to_sass_plugin_options[:load_paths].find{|p| p.is_a?(Sass::Importers::Filesystem) && p.root == "/tmp/foo"}
|
|
|
|
end
|
|
|
|
|
2010-02-20 21:06:29 +00:00
|
|
|
def test_config_with_pathname
|
|
|
|
contents = StringIO.new(<<-CONFIG)
|
|
|
|
http_path = "/"
|
|
|
|
project_path = Pathname.new("/home/chris/my_compass_project")
|
|
|
|
css_dir = "css"
|
|
|
|
additional_import_paths = ["../foo"]
|
|
|
|
add_import_path "/path/to/my/framework"
|
|
|
|
CONFIG
|
|
|
|
|
|
|
|
Compass.add_configuration(contents, "test_additional_import_paths")
|
|
|
|
|
2011-04-24 23:41:56 +00:00
|
|
|
load_paths = load_paths_as_strings(Compass.configuration.to_sass_engine_options[:load_paths])
|
|
|
|
|
2011-07-19 15:33:11 +00:00
|
|
|
assert load_paths.include?("/home/chris/foo"), "Expected to find /home/chris/foo in #{load_paths.inspect}"
|
2011-04-24 23:41:56 +00:00
|
|
|
assert load_paths.include?("/path/to/my/framework"), load_paths.inspect
|
2010-05-09 06:52:31 +00:00
|
|
|
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]
|
2011-07-19 18:44:14 +00:00
|
|
|
|
|
|
|
expected_serialization = <<EXPECTED
|
|
|
|
# Require any additional compass plugins here.
|
|
|
|
project_path = "/home/chris/my_compass_project"
|
|
|
|
|
|
|
|
http_path = "/"
|
|
|
|
css_dir = "css"
|
|
|
|
|
|
|
|
# You can select your preferred output style here (can be overridden via the command line):
|
|
|
|
# output_style = :expanded or :nested or :compact or :compressed
|
|
|
|
|
|
|
|
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
|
|
# relative_assets = true
|
|
|
|
additional_import_paths = ["../foo", "/path/to/my/framework"]
|
|
|
|
|
|
|
|
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
|
|
# line_comments = false
|
|
|
|
EXPECTED
|
2009-07-04 01:45:19 +00:00
|
|
|
assert_equal "/", Compass.configuration.http_path
|
2011-07-19 18:44:14 +00:00
|
|
|
assert_correct expected_serialization.split("\n"), Compass.configuration.serialize.split("\n")
|
2009-06-27 19:15:28 +00:00
|
|
|
end
|
|
|
|
|
2009-06-27 20:05:30 +00:00
|
|
|
def test_sass_options
|
2009-08-25 21:18:58 +00:00
|
|
|
contents = StringIO.new(<<-CONFIG)
|
2009-06-27 20:05:30 +00:00
|
|
|
sass_options = {:foo => 'bar'}
|
|
|
|
CONFIG
|
|
|
|
|
2009-08-25 21:18:58 +00:00
|
|
|
Compass.add_configuration(contents, "test_sass_options")
|
2009-06-27 20:05:30 +00:00
|
|
|
|
|
|
|
assert_equal 'bar', Compass.configuration.to_sass_engine_options[:foo]
|
|
|
|
assert_equal 'bar', Compass.configuration.to_sass_plugin_options[:foo]
|
2011-07-19 18:44:14 +00:00
|
|
|
|
|
|
|
expected_serialization = <<EXPECTED
|
|
|
|
# Require any additional compass plugins here.
|
|
|
|
|
|
|
|
# Set this to the root of your project when deployed:
|
|
|
|
http_path = \"/\"
|
|
|
|
|
|
|
|
# You can select your preferred output style here (can be overridden via the command line):
|
|
|
|
# output_style = :expanded or :nested or :compact or :compressed
|
|
|
|
|
|
|
|
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
|
|
# relative_assets = true\nsass_options = {:foo=>\"bar\"}
|
|
|
|
|
|
|
|
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
|
|
# line_comments = false
|
|
|
|
|
2012-01-29 21:06:57 +00:00
|
|
|
EXPECTED
|
|
|
|
|
|
|
|
assert_correct(expected_serialization, Compass.configuration.serialize)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_sprite_load_path_clobbers
|
|
|
|
contents = StringIO.new(<<-CONFIG)
|
|
|
|
sprite_load_path = ["/Users/chris/Projects/my_compass_project/images/sprites"]
|
|
|
|
CONFIG
|
|
|
|
|
|
|
|
Compass.add_configuration(contents, "test_sass_options")
|
|
|
|
|
|
|
|
assert_equal ["/Users/chris/Projects/my_compass_project/images/sprites"], Compass.configuration.sprite_load_path.to_a
|
|
|
|
|
|
|
|
expected_serialization = <<EXPECTED
|
|
|
|
# Require any additional compass plugins here.
|
|
|
|
|
|
|
|
# Set this to the root of your project when deployed:
|
|
|
|
http_path = "/"
|
|
|
|
|
|
|
|
# You can select your preferred output style here (can be overridden via the command line):
|
|
|
|
# output_style = :expanded or :nested or :compact or :compressed
|
|
|
|
|
|
|
|
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
|
|
# relative_assets = true
|
|
|
|
|
|
|
|
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
|
|
# line_comments = false
|
|
|
|
|
|
|
|
sprite_load_path = ["/Users/chris/Projects/my_compass_project/images/sprites"]
|
2011-07-19 18:44:14 +00:00
|
|
|
EXPECTED
|
|
|
|
|
|
|
|
assert_correct(expected_serialization, Compass.configuration.serialize)
|
2009-06-27 20:05:30 +00:00
|
|
|
end
|
|
|
|
|
2010-01-10 20:26:42 +00:00
|
|
|
def test_strip_trailing_directory_separators
|
|
|
|
contents = StringIO.new(<<-CONFIG)
|
|
|
|
css_dir = "css/"
|
|
|
|
sass_dir = "sass/"
|
|
|
|
images_dir = "images/"
|
|
|
|
javascripts_dir = "js/"
|
|
|
|
fonts_dir = "fonts/"
|
|
|
|
extensions_dir = "extensions/"
|
|
|
|
css_path = "css/"
|
|
|
|
sass_path = "sass/"
|
|
|
|
images_path = "images/"
|
|
|
|
javascripts_path = "js/"
|
|
|
|
fonts_path = "fonts/"
|
|
|
|
extensions_path = "extensions/"
|
|
|
|
CONFIG
|
|
|
|
|
|
|
|
Compass.add_configuration(contents, "test_strip_trailing_directory_separators")
|
|
|
|
|
|
|
|
assert_equal "css", Compass.configuration.css_dir
|
|
|
|
assert_equal "sass", Compass.configuration.sass_dir
|
|
|
|
assert_equal "images", Compass.configuration.images_dir
|
|
|
|
assert_equal "js", Compass.configuration.javascripts_dir
|
|
|
|
assert_equal "fonts", Compass.configuration.fonts_dir
|
|
|
|
assert_equal "extensions", Compass.configuration.extensions_dir
|
|
|
|
end
|
2011-04-17 18:29:20 +00:00
|
|
|
|
|
|
|
def test_custom_configuration_properties
|
|
|
|
# Add a configuration property to compass.
|
|
|
|
Compass::Configuration.add_configuration_property(:foobar, "this is a foobar") do
|
|
|
|
if environment == :production
|
|
|
|
"foo"
|
|
|
|
else
|
|
|
|
"bar"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
contents = StringIO.new(<<-CONFIG)
|
|
|
|
foobar = "baz"
|
|
|
|
CONFIG
|
|
|
|
|
|
|
|
Compass.add_configuration(contents, "test_strip_trailing_directory_separators")
|
|
|
|
|
|
|
|
assert_equal "baz", Compass.configuration.foobar
|
2011-07-19 18:44:14 +00:00
|
|
|
expected_serialization = <<EXPECTED
|
|
|
|
# Require any additional compass plugins here.
|
|
|
|
|
|
|
|
# Set this to the root of your project when deployed:
|
|
|
|
http_path = "/"
|
|
|
|
|
|
|
|
# You can select your preferred output style here (can be overridden via the command line):
|
|
|
|
# output_style = :expanded or :nested or :compact or :compressed
|
|
|
|
|
|
|
|
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
|
|
# relative_assets = true
|
|
|
|
|
|
|
|
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
|
|
# line_comments = false
|
|
|
|
|
|
|
|
|
|
|
|
# this is a foobar
|
|
|
|
foobar = "baz"
|
|
|
|
EXPECTED
|
|
|
|
assert_correct(expected_serialization, Compass.configuration.serialize)
|
2011-04-17 18:29:20 +00:00
|
|
|
Compass.reset_configuration!
|
|
|
|
Compass.configuration.environment = :production
|
|
|
|
assert_equal "foo", Compass.configuration.foobar
|
|
|
|
Compass.configuration.environment = :development
|
|
|
|
assert_equal "bar", Compass.configuration.foobar
|
|
|
|
ensure
|
|
|
|
Compass::Configuration.remove_configuration_property :foobar
|
|
|
|
end
|
2011-04-24 23:41:56 +00:00
|
|
|
|
|
|
|
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
|
2011-04-28 03:18:52 +00:00
|
|
|
|
2009-11-19 10:26:35 +00:00
|
|
|
end
|