Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8461 from frodsan/fix_assert_method_generators

Fix #assert_instance_method to also assert indented methods
  • Loading branch information...
commit 49295e72d3f50e28d12aee2f41a049ac685effa7 2 parents 40991dd + 0e027f4
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  railties/lib/rails/generators/test_case.rb
View
2  railties/lib/rails/generators/test_case.rb
@@ -163,7 +163,7 @@ def assert_class_method(method, content, &block)
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.