Top Level Namespace

Defined Under Namespace

Modules: RSpec, Rails, TmpRails Classes: TestApp

Instance Method Summary collapse

Instance Method Details

#require_generators(*generator_list) ⇒ Object Also known as: require_generator

require the generators



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generator-spec/rspec/generator/require.rb', line 2

def require_generators *generator_list     
  req = RSpec::Generator::Require
  generator_list.each do |name, generators|
    case name
    when Hash
      req.parse_generator_hash name      
    when Symbol
      req.require_all_generators and return if name == :all
      if !generators || generators.empty?
        req.require_generator! name
      else
        req.parse_generator_list name, generators  
      end
    else
      raise ArgumentError, "required generator(s) must be stated either using a symbol or array of symbols"      
    end
  end
end