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 commit81f243375b
, reversing changes made toc7673b0981
.
This commit is contained in:
parent
81f243375b
commit
334e260c5f
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue