class Pact::VerificationTask
Attributes
Public Class Methods
Source
# File lib/pact/tasks/verification_task.rb, line 36 def initialize(name) @rspec_opts = nil @ignore_failures = false @pact_spec_configs = [] @name = name yield self rake_task end
Public Instance Methods
Source
# File lib/pact/tasks/verification_task.rb, line 45 def pact_helper(pact_helper) @pact_spec_configs << { pact_helper: pact_helper } end
Source
# File lib/pact/tasks/verification_task.rb, line 49 def uri(uri, options = {}) @pact_spec_configs << {uri: uri, pact_helper: options[:pact_helper]} end
Private Instance Methods
Source
# File lib/pact/tasks/verification_task.rb, line 75 def rake_task namespace :pact do desc "Verify provider against the consumer pacts for #{name}" task "verify:#{name}" do |t, args| require 'pact/tasks/task_helper' exit_statuses = pact_spec_configs.collect do | config | Pact::TaskHelper.execute_pact_verify config[:uri], config[:pact_helper], rspec_opts, { ignore_failures: ignore_failures } end Pact::TaskHelper.handle_verification_failure do exit_statuses.count{ | status | status != 0 } end end end end
FileUtils.mkdir_p reports_dir File.open("#{reports_dir}/#{report.report_file_name}", "w") { |file| file << JSON.pretty_generate(report) }
end