lib/rubigen/helpers/generator_test_helper.rb
def assert_generated_class(path,parent=nil)
      path=~/\/?(\d+_)?(\w+)$/
      class_name=$2.camelize
      assert_generated_file("#{path}.rb") do |body|
        assert body=~/class #{class_name}#{parent.nil? ? '':" < #{parent}"}/,"the file '#{path}.rb' should be a class"
        yield body if block_given?
      end
    end
# asserts that the given class source file was generated.
# It takes a path without the <tt>.rb</tt> part and an optional super class.
# the contents of the class source file is passed to a block.
asserts that the given class source file was generated.
It takes a path without the .rb part and an optional super class.
the contents of the class source file is passed to a block.
asserts that the given class source file was generated . It takes a path without the . rb part and an optional super class . the contents of the class source file is passed to a block .
def assert_generated_class(path,parent=nil)
      path=~/\/?(\d+_)?(\w+)$/
      class_name=$2.camelize
      assert_generated_file("#{path}.rb") do |body|
        assert body=~/class #{class_name}#{parent.nil? ? '':" < #{parent}"}/,"the file '#{path}.rb' should be a class"
        yield body if block_given?
      end
    end
def assert_generated_class ( path , parent = nil ) path =~ / \/ ?( \d +_)?( \w +)$ / class_name = $2 . camelize assert_generated_file ( "#{path}.rb" ) do | body | assert body =~ / class  #{ class_name } #{ parent . nil? ? '' : " < #{parent}" } / , "the file '#{path}.rb' should be a class" yield body if block_given? end end
asserts that the given class source file was generated.
asserts that the given class source file was generated .
path
parent