Class: RSpec::Permutations::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/permutations/parser.rb

Defined Under Namespace

Classes: PermutationBlock, Table

Instance Method Summary collapse

Constructor Details

#initialize(spec_file) ⇒ Parser

Returns a new instance of Parser.



6
7
8
# File 'lib/rspec/permutations/parser.rb', line 6

def initialize(spec_file)
  @spec_file = spec_file
end

Instance Method Details

#permutations(name = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/rspec/permutations/parser.rb', line 10

def permutations(name = nil)
  if name
    permutation_blocks.find { |pb| pb.name == name }.permutations
  else
    permutation_blocks.first.permutations
  end
end