Class: PactBroker::Pacts::Diff::DiffDecorator

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/pacts/diff.rb

Overview

The next pact version after the previous distinct version. Eg. v1 (previous distinct) -> pactContentA

v2 (next pact)         -> pactContentB
v3                     -> pactContentB
v4 (current)           -> pactContentB

If we are at v4, then the previous distinct pact version is v1, and the next pact after that is v2. The timestamps on v2 are the ones we want - that’s when the latest distinct version content was first created.

Instance Method Summary collapse

Constructor Details

#initialize(pact, comparison_pact, next_pact, base_url, options) ⇒ DiffDecorator

Returns a new instance of DiffDecorator.



52
53
54
55
56
57
58
# File 'lib/pact_broker/pacts/diff.rb', line 52

def initialize(pact, comparison_pact, next_pact, base_url, options)
  @pact = pact
  @comparison_pact = comparison_pact
  @next_pact = next_pact
  @base_url = base_url
  @options = options
end

Instance Method Details

#to_textObject



60
61
62
# File 'lib/pact_broker/pacts/diff.rb', line 60

def to_text
  header + "\n\n" + diff + "\n\n" + links
end