Exception: Bogus::ContractNotFulfilled
- Inherits:
-
StandardError
- Object
- StandardError
- Bogus::ContractNotFulfilled
- Defined in:
- lib/bogus/contracts/contract_not_fulfilled.rb
Instance Attribute Summary collapse
-
#actual_interactions ⇒ Object
readonly
Returns the value of attribute actual_interactions.
-
#fake_name ⇒ Object
readonly
Returns the value of attribute fake_name.
-
#missed_interactions ⇒ Object
readonly
Returns the value of attribute missed_interactions.
Instance Method Summary collapse
-
#initialize(fake_name, opts = {}) ⇒ ContractNotFulfilled
constructor
A new instance of ContractNotFulfilled.
- #message ⇒ Object
Constructor Details
#initialize(fake_name, opts = {}) ⇒ ContractNotFulfilled
Returns a new instance of ContractNotFulfilled.
5 6 7 8 9 10 |
# File 'lib/bogus/contracts/contract_not_fulfilled.rb', line 5 def initialize(fake_name, opts = {}) @fake_name = fake_name @actual_interactions = opts.fetch(:actual) @missed_interactions = opts.fetch(:missed) super() end |
Instance Attribute Details
#actual_interactions ⇒ Object (readonly)
Returns the value of attribute actual_interactions.
3 4 5 |
# File 'lib/bogus/contracts/contract_not_fulfilled.rb', line 3 def actual_interactions @actual_interactions end |
#fake_name ⇒ Object (readonly)
Returns the value of attribute fake_name.
3 4 5 |
# File 'lib/bogus/contracts/contract_not_fulfilled.rb', line 3 def fake_name @fake_name end |
#missed_interactions ⇒ Object (readonly)
Returns the value of attribute missed_interactions.
3 4 5 |
# File 'lib/bogus/contracts/contract_not_fulfilled.rb', line 3 def missed_interactions @missed_interactions end |
Instance Method Details
#message ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bogus/contracts/contract_not_fulfilled.rb', line 12 def 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 |