Sha256: e72c23ca014a6634c7f783eef1b11aa5cb4dc16ceb119cbbf1b34eebfebcf7e2
Contents?: true
Size: 757 Bytes
Versions: 12
Compression:
Stored size: 757 Bytes
Contents
module Bogus class ContractNotFulfilled < StandardError attr_reader :fake_name, :missed_interactions, :actual_interactions def initialize(fake_name, opts = {}) @fake_name = fake_name @actual_interactions = opts.fetch(:actual) @missed_interactions = opts.fetch(:missed) super(message) end def message str = <<-EOF Contract not fullfilled for #{fake_name}! Missed interactions: #{interactions_str(missed_interactions)} Actual interactions: #{interactions_str(actual_interactions)} EOF str.gsub(' ' * 6, '') end private def interactions_str(interactions) interactions.map { |i| " - #{InteractionPresenter.new(i)}" }.join("\n") end end end
Version data entries
12 entries across 12 versions & 1 rubygems