Class: Pact::MockService::Interactions::MergingInteractionsFilter
Instance Method Summary
collapse
#index_of, #initialize
Instance Method Details
#<<(interaction) ⇒ Object
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/pact/mock_service/interactions/interactions_filter.rb', line 48
def << interaction
if (ndx = index_of(interaction))
if same_same_but_different?(@interactions[ndx], interaction)
message = Interactions::InteractionDiffMessage.new(@interactions[ndx], interaction).to_s
raise SameSameButDifferentError, message
end
@interactions[ndx] = interaction
else
@interactions << interaction
end
end
|
#same_same_but_different?(existing_interaction, new_interaction) ⇒ Boolean
60
61
62
|
# File 'lib/pact/mock_service/interactions/interactions_filter.rb', line 60
def same_same_but_different?(existing_interaction, new_interaction)
existing_interaction != new_interaction
end
|