module GeneratorSpec::GeneratorExampleGroup::InstanceMethods
def assert_instance_method(method, content)
end
end
assert_match /Product\.all/, index
assert_instance_method :index, content do |index|
assert_file "app/controller/products_controller.rb" do |controller|
it yields the content of the method.
Asserts the given method exists in the given content. When a block is given,
def assert_instance_method(method, content) assert content =~ /def #{method}(\(.+\))?(.*?)\n end/m, "Expected to have method #{method}" yield $2.strip if block_given? end