Exception: TestBench::Assert::Failed

Inherits:
StandardError
  • Object
show all
Defined in:
lib/test_bench/assert/failed.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_locationsObject (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

#backtraceObject



16
17
18
# File 'lib/test_bench/assert/failed.rb', line 16

def backtrace
  backtrace_locations.map(&:to_s)
end

#to_sObject



20
21
22
# File 'lib/test_bench/assert/failed.rb', line 20

def to_s
  "Assertion failed"
end