Fix method assertion ensuring it will match "end" with the same indentation
Otherwise it was matching "end" lines from blocks within the method body, making tests such as the migration ones fail.
This commit is contained in:
parent
61b528ede0
commit
314e4bbaea
|
@ -163,8 +163,8 @@ module Rails
|
|||
# end
|
||||
# end
|
||||
def assert_instance_method(method, content)
|
||||
assert content =~ /def #{method}(\(.+\))?(.*?)\n\s+end/m, "Expected to have method #{method}"
|
||||
yield $2.strip if block_given?
|
||||
assert content =~ /(\s+)def #{method}(\(.+\))?(.*?)\n\1end/m, "Expected to have method #{method}"
|
||||
yield $3.strip if block_given?
|
||||
end
|
||||
alias :assert_method :assert_instance_method
|
||||
|
||||
|
|
Loading…
Reference in New Issue