Exception: Muack::Failure

Inherits:
StandardError
  • Object
show all
Defined in:
lib/muack/failure.rb

Direct Known Subclasses

Expected, Unexpected

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expectedObject (readonly)

Returns the value of attribute expected.



4
5
6
# File 'lib/muack/failure.rb', line 4

def expected
  @expected
end

Instance Method Details

#build_expected(obj, expected_defis) ⇒ Object



5
6
7
8
9
10
# File 'lib/muack/failure.rb', line 5

def build_expected obj, expected_defis
  @expected = expected_defis.uniq{ |d| [d.msg, d.args] }.map{ |defi|
                "#{obj.inspect}.#{defi.msg}(" \
                "#{defi.args.map(&:inspect).join(', ')})"
              }.join("\n      or: ")
end