aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-12-08 09:44:45 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-12-08 09:44:45 -0500
commit0e027f4fe31b652baf9a845a552f3d99fd3ec10d (patch)
tree16de380f6557846c62e251bb364b496252e8f05e /railties
parent69163ccae6a49c89e1a62ac94b98222651dd5aa8 (diff)
downloadrails-0e027f4fe31b652baf9a845a552f3d99fd3ec10d.tar.gz
rails-0e027f4fe31b652baf9a845a552f3d99fd3ec10d.tar.bz2
rails-0e027f4fe31b652baf9a845a552f3d99fd3ec10d.zip
Fix #assert_instance_method to also assert indented methods
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/test_case.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb
index 24308dcf6c..01e0e66d89 100644
--- a/railties/lib/rails/generators/test_case.rb
+++ b/railties/lib/rails/generators/test_case.rb
@@ -163,7 +163,7 @@ module Rails
# end
# end
def assert_instance_method(method, content)
- assert content =~ /def #{method}(\(.+\))?(.*?)\n end/m, "Expected to have method #{method}"
+ assert content =~ /def #{method}(\(.+\))?(.*?)\n\s+end/m, "Expected to have method #{method}"
yield $2.strip if block_given?
end
alias :assert_method :assert_instance_method