Update unit tests to work with the new timestamp checking support for the compass compiler.

This commit is contained in:
Chris Eppstein 2009-05-07 12:29:06 -07:00
parent b7f38e40f7
commit 9a9b0b3d43

View File

@ -55,7 +55,11 @@ FRAMEWORKS
within_tmp_directory do within_tmp_directory do
compass "basic" compass "basic"
Dir.chdir "basic" do Dir.chdir "basic" do
# basic update with timestamp caching
compass compass
assert_action_performed :unchanged, "src/screen.sass"
# basic update with force option set
compass "--force"
assert_action_performed :compile, "src/screen.sass" assert_action_performed :compile, "src/screen.sass"
assert_action_performed :identical, "stylesheets/screen.css" assert_action_performed :identical, "stylesheets/screen.css"
end end
@ -126,11 +130,15 @@ FRAMEWORKS
end end
def assert_action_performed(action, path) def assert_action_performed(action, path)
actions_found = []
@last_result.split("\n").each do |line| @last_result.split("\n").each do |line|
line = line.split line = line.split
return if line.first == action.to_s && line.last == path return if line.first == action.to_s && line.last == path
actions_found << line.first if line.last == path
end end
fail "Action #{action.inspect} was not performed on: #{path}" message = "Action #{action.inspect} was not performed on: #{path}."
message += "The following actions were performed: #{actions_found.join(", ")}" if actions_found.any?
fail message
end end
def within_tmp_directory(dir = "tmp") def within_tmp_directory(dir = "tmp")