mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #8461 from frodsan/fix_assert_method_generators
Fix #assert_instance_method to also assert indented methods
This commit is contained in:
commit
49295e72d3
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ module Rails
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
def assert_instance_method(method, content)
|
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?
|
yield $2.strip if block_given?
|
||||||
end
|
end
|
||||||
alias :assert_method :assert_instance_method
|
alias :assert_method :assert_instance_method
|
||||||
|
|
Loading…
Reference in a new issue