Class: PactBroker::Domain::Verification

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/pact_broker/domain/verification.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object

So consumer_version_tag_name can be accessed by method name



185
186
187
188
189
190
191
# File 'lib/pact_broker/domain/verification.rb', line 185

def method_missing(m, *args, &block)
  if values.key?(m) && args.size == 0
    values[m]
  else
    super
  end
end

Instance Method Details

#all_interactions_missing_test_results?Boolean

Returns:

  • (Boolean)


176
177
178
# File 'lib/pact_broker/domain/verification.rb', line 176

def all_interactions_missing_test_results?
  pact_content_with_test_results.interactions.count == pact_content_with_test_results.interactions_missing_test_results.count
end

#before_createObject



22
23
24
25
# File 'lib/pact_broker/domain/verification.rb', line 22

def before_create
  super
  self.execution_date ||= DateTime.now
end

#consumer_nameObject



152
153
154
# File 'lib/pact_broker/domain/verification.rb', line 152

def consumer_name
  consumer.name
end

#interactions_missing_test_resultsObject



172
173
174
# File 'lib/pact_broker/domain/verification.rb', line 172

def interactions_missing_test_results
  @interactions_missing_test_results ||= pact_content_with_test_results.interactions_missing_test_results
end

#latest_pact_publicationObject



168
169
170
# File 'lib/pact_broker/domain/verification.rb', line 168

def latest_pact_publication
  pact_version.latest_pact_publication
end

#pact_content_with_test_resultsObject



180
181
182
# File 'lib/pact_broker/domain/verification.rb', line 180

def pact_content_with_test_results
  @pact_content_with_test_results = PactBroker::Pacts::Content.from_json(pact_version.content).with_test_results(test_results)
end

#pact_version_shaObject



148
149
150
# File 'lib/pact_broker/domain/verification.rb', line 148

def pact_version_sha
  pact_version.sha
end

#provider_nameObject



156
157
158
# File 'lib/pact_broker/domain/verification.rb', line 156

def provider_name
  provider.name
end

#provider_version_numberObject



160
161
162
# File 'lib/pact_broker/domain/verification.rb', line 160

def provider_version_number
  provider_version.number
end

#provider_version_tag_namesObject



164
165
166
# File 'lib/pact_broker/domain/verification.rb', line 164

def provider_version_tag_names
  provider_version.tags.collect(&:name)
end