1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Merge pull request #10194 from pabloh/extract_regexp_at_generators_testing_assertion"

This reverts commit 81f243375b, reversing
changes made to c7673b0981.
This commit is contained in:
Carlos Antonio da Silva 2013-04-12 21:16:05 -03:00
parent 81f243375b
commit 334e260c5f

View file

@ -2,8 +2,6 @@ module Rails
module Generators
module Testing
module Assertions
METHOD_DECLARATION_REGEXP = /(\s+)def #{method}(\(.+\))?(.*?)\n\1end/m
# Asserts a given file exists. You need to supply an absolute path or a path relative
# to the configured destination:
#
@ -98,7 +96,7 @@ module Rails
# end
# end
def assert_instance_method(method, content)
assert content =~ METHOD_DECLARATION_REGEXP, "Expected to have method #{method}"
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