From 334e260c5fae975fc222b5f2db19638625fec556 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 12 Apr 2013 21:16:05 -0300 Subject: Revert "Merge pull request #10194 from pabloh/extract_regexp_at_generators_testing_assertion" This reverts commit 81f243375b9d3cfd431c1ca904c5c1efc9a41ae8, reversing changes made to c7673b0981d961e5510c85d958c944876d543314. --- railties/lib/rails/generators/testing/assertions.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/testing/assertions.rb b/railties/lib/rails/generators/testing/assertions.rb index 14fd4efd4e..6267b2f2ee 100644 --- a/railties/lib/rails/generators/testing/assertions.rb +++ b/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 @@ 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 -- cgit v1.2.3