Exception: TestBench::Assert::Failed
- Inherits:
-
StandardError
- Object
- StandardError
- TestBench::Assert::Failed
- Defined in:
- lib/test_bench/assert/failed.rb
Instance Attribute Summary collapse
-
#backtrace_locations ⇒ Object
readonly
Returns the value of attribute backtrace_locations.
Class Method Summary collapse
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(backtrace_locations) ⇒ Failed
constructor
A new instance of Failed.
- #to_s ⇒ Object
Constructor Details
#initialize(backtrace_locations) ⇒ Failed
Returns a new instance of Failed.
6 7 8 |
# File 'lib/test_bench/assert/failed.rb', line 6 def initialize backtrace_locations @backtrace_locations = backtrace_locations end |
Instance Attribute Details
#backtrace_locations ⇒ Object (readonly)
Returns the value of attribute backtrace_locations.
4 5 6 |
# File 'lib/test_bench/assert/failed.rb', line 4 def backtrace_locations @backtrace_locations end |
Class Method Details
.build(backtrace_location = nil) ⇒ Object
10 11 12 13 14 |
# File 'lib/test_bench/assert/failed.rb', line 10 def self.build backtrace_location=nil backtrace_location ||= caller_locations[0] new [backtrace_location] end |
Instance Method Details
#backtrace ⇒ Object
16 17 18 |
# File 'lib/test_bench/assert/failed.rb', line 16 def backtrace backtrace_locations.map(&:to_s) end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/test_bench/assert/failed.rb', line 20 def to_s "Assertion failed" end |