mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix #assert_instance_method to also assert indented methods
This commit is contained in:
parent
69163ccae6
commit
0e027f4fe3
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue