Fixed bug where some koans were not generated properly.

This commit is contained in:
Jim Weirich
2010-10-01 11:05:25 -04:00
parent fdb8774c95
commit e5843f64fd
2 changed files with 7 additions and 4 deletions

View File

@@ -36,12 +36,12 @@ class AboutMethods < EdgeCase::Koan
exception = assert_raise(___) do
my_global_method
end
assert_match(/#{__ of arguments")}/, exception.message)
assert_match(/__/, exception.message)
exception = assert_raise(___) do
my_global_method(1,2,3)
end
assert_match(/#{__ of arguments")}/, exception.message)
assert_match(/__/, exception.message)
end
# ------------------------------------------------------------------

View File

@@ -43,12 +43,15 @@ class AboutMethods < EdgeCase::Koan
exception = assert_raise(___(ArgumentError)) do
my_global_method
end
assert_match(/#{__("wrong (number|#) of arguments")}/, exception.message)
#--
pattern = "wrong (number|#) of arguments"
#++
assert_match(/#{__(pattern)}/, exception.message)
exception = assert_raise(___(ArgumentError)) do
my_global_method(1,2,3)
end
assert_match(/#{__("wrong (number|#) of arguments")}/, exception.message)
assert_match(/#{__(pattern)}/, exception.message)
end
# ------------------------------------------------------------------