1
0
Fork 0
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:
Francesco Rodriguez 2012-12-08 09:44:45 -05:00
parent 69163ccae6
commit 0e027f4fe3

View file

@ -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