[Tests] Process expected result files thru erb to account for more transient behaviors across different systems.

This commit is contained in:
Chris Eppstein 2009-11-24 08:29:02 -08:00
parent f312a24012
commit 9b8830b891
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ private
actual_result_file = "#{tempfile_path(@current_project)}/#{name}.css" actual_result_file = "#{tempfile_path(@current_project)}/#{name}.css"
expected_result_file = "#{result_path(@current_project)}/#{name}.css" expected_result_file = "#{result_path(@current_project)}/#{name}.css"
actual_lines = File.read(actual_result_file).split("\n") actual_lines = File.read(actual_result_file).split("\n")
expected_lines = File.read(expected_result_file).split("\n") expected_lines = ERB.new(File.read(expected_result_file)).result(binding).split("\n")
expected_lines.zip(actual_lines).each_with_index do |pair, line| expected_lines.zip(actual_lines).each_with_index do |pair, line|
message = "template: #{name}\nline: #{line + 1}" message = "template: #{name}\nline: #{line + 1}"
assert_equal(pair.first, pair.last, message) assert_equal(pair.first, pair.last, message)

View File

@ -1 +1 @@
test { background: url('../assets/images/testing.png?1258839056'); } test { background: url('../assets/images/testing.png?<%= File.mtime(File.join(Compass.configuration.project_path, 'assets', 'images', 'testing.png')).strftime("%s") %>'); }