diff --git a/Gemfile b/Gemfile index 23e3b6d6..920ce595 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,8 @@ gem 'autotest-fsevent' if RUBY_PLATFORM =~ /darwin/ gem 'fakefs', :git => 'git://github.com/johnbintz/fakefs.git' gem 'mocha' gem 'timecop' +gem 'diff-lcs', '~> 1.1.2' + diff --git a/Gemfile.lock b/Gemfile.lock index ec2d4004..94766d49 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,10 +7,10 @@ GIT PATH remote: . specs: - compass (0.11.1) - chunky_png (~> 1.1.1) + compass (0.11.1.f1061c4) + chunky_png (~> 1.1) fssm (>= 0.2.7) - sass (>= 3.1.0.alpha.249) + sass (~> 3.1) GEM remote: http://rubygems.org/ @@ -71,7 +71,6 @@ GEM gherkin (2.2.9) json (~> 1.4.6) term-ansicolor (~> 1.0.5) - haml (3.1.0) i18n (0.5.0) json (1.4.6) livereload (1.6) @@ -120,7 +119,7 @@ GEM ruby-json (1.1.2) ruby-prof (0.10.5) rubyzip (0.9.4) - sass (3.1.0.alpha.263) + sass (3.1.1) sys-uname (0.8.5) term-ansicolor (1.0.5) thor (0.14.6) @@ -139,8 +138,8 @@ DEPENDENCIES compass-validator (= 3.0.0) css_parser (~> 1.0.1) cucumber (~> 0.9.2) + diff-lcs (~> 1.1.2) fakefs! - haml (~> 3.1.0.alpha) livereload mocha rails (~> 3.0.0.rc) @@ -149,5 +148,4 @@ DEPENDENCIES rspec (~> 2.0.0) ruby-prof rubyzip - sass (= 3.1.0.alpha.263) timecop diff --git a/test/compass_test.rb b/test/compass_test.rb index 02920954..26491328 100644 --- a/test/compass_test.rb +++ b/test/compass_test.rb @@ -5,18 +5,14 @@ require 'compass/logger' require 'sass/plugin' class CompassTest < Test::Unit::TestCase - include Compass::TestCaseHelper + def setup Compass.reset_configuration! end def teardown - teardown_fixtures :blueprint, :empty, :compass, :image_urls, :relative - end - - def teardown_fixtures(*project_names) - project_names.each do |project_name| - FileUtils.rm_rf tempfile_path(project_name) + [:blueprint, :empty, :compass, :image_urls, :relative].each do |project_name| + ::FileUtils.rm_rf tempfile_path(project_name) end end @@ -117,7 +113,11 @@ private expected_lines = expected_lines.split("\n").reject{|l| l=~/\A\Z/} expected_lines.zip(actual_lines).each_with_index do |pair, line| message = "template: #{name}\nline: #{line + 1}" - assert_equal(pair.first, pair.last, message) + if pair.first == pair.last + assert(true) + else + assert false, diff_as_string(pair.first.inspect, pair.last.inspect) + end end if expected_lines.size < actual_lines.size assert(false, "#{actual_lines.size - expected_lines.size} Trailing lines found in #{actual_result_file}.css: #{actual_lines[expected_lines.size..-1].join('\n')}") diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 419e5b27..3e97a722 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -3,9 +3,12 @@ require 'compass' require 'stringio' class ConfigurationTest < Test::Unit::TestCase - include Compass::IoHelper - def setup + setup do + Compass.reset_configuration! + end + + after do Compass.reset_configuration! end @@ -15,18 +18,23 @@ class ConfigurationTest < Test::Unit::TestCase # Require any additional compass plugins here. project_type = :stand_alone + # Set this to the root of your project when deployed: http_path = "/" css_dir = "css" sass_dir = "sass" images_dir = "img" javascripts_dir = "js" + output_style = :nested + # 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 + # 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 @@ -43,7 +51,7 @@ class ConfigurationTest < Test::Unit::TestCase expected_lines = contents.string.split("\n").map{|l|l.strip} actual_lines = Compass.configuration.serialize.split("\n").map{|l|l.strip} - assert_equal expected_lines, actual_lines + assert_correct expected_lines, actual_lines end def test_serialization_warns_with_asset_host_set @@ -101,19 +109,23 @@ class ConfigurationTest < Test::Unit::TestCase expected_serialization = <"bar"} +# relative_assets = true\nsass_options = {:foo=>\"bar\"} + # To disable debugging comments that display the original location of your selectors. Uncomment: # line_comments = false + EXPECTED - assert_equal expected_serialization, Compass.configuration.serialize + assert_correct(expected_serialization, Compass.configuration.serialize) end def test_strip_trailing_directory_separators @@ -223,18 +243,24 @@ EXPECTED assert_equal "baz", Compass.configuration.foobar expected_serialization = <