Class: Pairwise::TestPair

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pairwise/test_pair.rb

Instance Method Summary collapse

Constructor Details

#initialize(p1_position, p2_position, p1, p2) ⇒ TestPair

Returns a new instance of TestPair.



9
10
11
12
13
# File 'lib/pairwise/test_pair.rb', line 9

def initialize(p1_position, p2_position, p1, p2)
  @p1, @p2 = p1, p2
  @p1_position, @p2_position = p1_position, p2_position
  @pair = [@p1, @p2]
end

Instance Method Details

#covered_by?(test_pair) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
# File 'lib/pairwise/test_pair.rb', line 15

def covered_by?(test_pair)
  debugger unless test_pair 
  test_pair[@p1_position] == @p1 &&
  test_pair[@p2_position] == @p2
end

#replace_wild_card(new_input_combinations) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/pairwise/test_pair.rb', line 21

def replace_wild_card(new_input_combinations)
  #TODO: Decided if we should replace all matches or single matches?
  if wild_card_index = find_wild_card_index(new_input_combinations)
    new_input_combinations[wild_card_index][@p2_position] = @p2
  else
    new_input_combinations << create_input_list
  end
  new_input_combinations
end