Exception: Propr::Failure

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, counterex, shrunken, passed, skipped) ⇒ Failure

Returns a new instance of Failure.


55
56
57
58
# File 'lib/propr.rb', line 55

def initialize(exception, counterex, shrunken, passed, skipped)
  @exception, @counterex, @shrunken, @passed, @skipped =
    exception, counterex, shrunken, passed, skipped
end

Instance Attribute Details

#counterexObject (readonly)

Returns the value of attribute counterex.


53
54
55
# File 'lib/propr.rb', line 53

def counterex
  @counterex
end

#passedObject (readonly)

Returns the value of attribute passed.


53
54
55
# File 'lib/propr.rb', line 53

def passed
  @passed
end

#shrunkenObject (readonly)

Returns the value of attribute shrunken.


53
54
55
# File 'lib/propr.rb', line 53

def shrunken
  @shrunken
end

#skippedObject (readonly)

Returns the value of attribute skipped.


53
54
55
# File 'lib/propr.rb', line 53

def skipped
  @skipped
end

Instance Method Details

#backtraceObject


72
73
74
# File 'lib/propr.rb', line 72

def backtrace
  @exception.backtrace
end

#classObject


68
69
70
# File 'lib/propr.rb', line 68

def class
  @exception.class
end

#to_sObject Also known as: message


76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/propr.rb', line 76

def to_s
  if @shrunken.nil?
    [@exception.message,
     "input: #{counterex.map(&:inspect).join(", ")}",
     "after: #{@passed} passed, #{@skipped} skipped"].join("\n")
  else
    [@exception.message,
     "input:    #{counterex.map(&:inspect).join(", ")}",
     "shrunken: #{shrunken.map(&:inspect).join(", ")}",
     "after: #{@passed} passed, #{@skipped} skipped"].join("\n")
  end
end