lib/rubigen/helpers/generator_test_helper.rb
# asserts that the given methods are defined in the body.
# This does assume standard rails code conventions with regards to the source code.
# The body of each individual method is passed to a block.
asserts that the given methods are defined in the body.
This does assume standard rails code conventions with regards to the source code.
The body of each individual method is passed to a block.
asserts that the given methods are defined in the body . This does assume standard rails code conventions with regards to the source code . The body of each individual method is passed to a block .
def assert_has_method(body,*methods)
      methods.each do |name|
        assert body=~/^  def #{name.to_s}\n((\n|   .*\n)*)  end/,"should have method #{name.to_s}"
        yield( name, $1 ) if block_given?
      end
    end
def assert_has_method ( body , * methods ) methods . each do | name | assert body =~ / ^  def  #{ name . to_s } \n (( \n |   .* \n )*)  end / , "should have method #{name.to_s}" yield ( name , $1 ) if block_given? end end
asserts that the given methods are defined in the body.
asserts that the given methods are defined in the body .
body
<not_specific>
methods
<not_specific>