From e5843f64fd98ed74e24fac4d8fe1ba688698bb77 Mon Sep 17 00:00:00 2001 From: Jim Weirich Date: Fri, 1 Oct 2010 11:05:25 -0400 Subject: [PATCH] Fixed bug where some koans were not generated properly. --- koans/about_methods.rb | 4 ++-- src/about_methods.rb | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/koans/about_methods.rb b/koans/about_methods.rb index fde97e9..d36e9ab 100644 --- a/koans/about_methods.rb +++ b/koans/about_methods.rb @@ -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 # ------------------------------------------------------------------ diff --git a/src/about_methods.rb b/src/about_methods.rb index 78ed5b6..1497f9b 100644 --- a/src/about_methods.rb +++ b/src/about_methods.rb @@ -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 # ------------------------------------------------------------------