diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-08 08:00:52 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-08 08:00:52 -0800 |
commit | 49295e72d3f50e28d12aee2f41a049ac685effa7 (patch) | |
tree | 5b8132a63f87bdf354c36eeda61a93ca827b4448 /railties | |
parent | 40991dd4bcbd2d9de0d9ba1b775a103532d9fae7 (diff) | |
parent | 0e027f4fe31b652baf9a845a552f3d99fd3ec10d (diff) | |
download | rails-49295e72d3f50e28d12aee2f41a049ac685effa7.tar.gz rails-49295e72d3f50e28d12aee2f41a049ac685effa7.tar.bz2 rails-49295e72d3f50e28d12aee2f41a049ac685effa7.zip |
Merge pull request #8461 from frodsan/fix_assert_method_generators
Fix #assert_instance_method to also assert indented methods
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/test_case.rb | 2 |
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 |