Permalink
Browse files

Revert "Merge pull request #10194 from pabloh/extract_regexp_at_gener…

…ators_testing_assertion"

This reverts commit 81f2433, reversing
changes made to c7673b0.
  • Loading branch information...
1 parent 81f2433 commit 334e260c5fae975fc222b5f2db19638625fec556 @carlosantoniodasilva carlosantoniodasilva committed Apr 13, 2013
Showing with 1 addition and 3 deletions.
  1. +1 −3 railties/lib/rails/generators/testing/assertions.rb
@@ -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 @@ def assert_class_method(method, content, &block)
# 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

0 comments on commit 334e260

Please sign in to comment.