spec/generator_spec_helper.rb
# 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 generated_class?(path,parent=nil)
      path=~/\/?(\d+_)?(\w+)$/
      class_name=$2.camelize
      generated_file?("#{path}.rb") do |body|
        it "should define #{class_name} in #{path}.rb" do
          body.should match(/class #{class_name}#{parent.nil? ? '':" < #{parent}"}/)
        end
        yield body if block_given?
      end
    end
def generated_class? ( path , parent = nil ) path =~ / \/ ?( \d +_)?( \w +)$ / class_name = $2 . camelize generated_file? ( "#{path}.rb" ) do | body | it "should define #{class_name} in #{path}.rb" do body . should match ( / class  #{ class_name } #{ parent . nil? ? '' : " < #{parent}" } / ) end 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
<not_specific>
parent
<not_specific>