Sha256: 54406904b6cfb54020486b46ee57b0b2531f7fd342860b55d9d703eae6e15191

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 KB

Contents

module RSpec
  module Generator
  end
end

module RSpec
  module Rails
  end
end

module Rails
  module Generators
  end
end


module RSpec
  module RubyContentMatchers
  end
end

module RSpec
  module FileMatchers
  end
end

require_all File.dirname(__FILE__) + '/extensions'
require_all File.dirname(__FILE__) + '/helpers'
require_all File.dirname(__FILE__) + '/rails_helpers'
require_all File.dirname(__FILE__) + '/rspec_generator'


module RSpec::Core
  class ExampleGroup
    def with_generator &block
      RSpec::Generator.with_generator &block
    end
    
    def setup_generator test_method_name=nil, &block
      RSpec::Generator.setup_generator test_method_name, &block
    end
  end
end

class Class
  def use_orm orm
    class_eval do
      raise ArgumentError, "Unknown orm #{orm}" if ![:active_record, :mongoid, :mongo_mapper, :data_mapper].include?(orm)
      include "RSpec::Rails::Orm::#{orm.to_s.camelize}".constantize
    end
  end
  
  def helpers *types
    types.each{|type| include_helper type}
  end  
  alias_method :load_helper, :helpers
  alias_method :load_helpers, :helpers
  
  protected
  
  def include_helper type
    raise ArgumentError, "Can not specify for #{type}" if ![:migration, :model, :helper, :controller, :view, :observer, :mailer].include?(type)
    class_eval do
      include "RSpec::Rails::#{type.to_s.camelize}".constantize
    end
  end      
end

require 'generator_spec/require_generator'

require 'generator_spec/matchers/content/content_matcher'
require_all File.dirname(__FILE__) + '/matchers/content'

require_all File.dirname(__FILE__) + '/matchers/file'
require_all File.dirname(__FILE__) + '/matchers/migration'

require_all File.dirname(__FILE__) + '/matchers/helpers'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generator-spec-0.5.0 lib/generator_spec/main.rb