Exception: TestBench::Controls::Error
- Inherits:
-
StandardError
- Object
- StandardError
- TestBench::Controls::Error
show all
- Defined in:
- lib/test_bench/controls/error.rb
Defined Under Namespace
Classes: BacktraceLocation
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(backtrace_locations) ⇒ Error
Returns a new instance of Error.
50
51
52
|
# File 'lib/test_bench/controls/error.rb', line 50
def initialize backtrace_locations
@backtrace_locations = backtrace_locations
end
|
Instance Attribute Details
#backtrace_locations ⇒ Object
Returns the value of attribute backtrace_locations.
48
49
50
|
# File 'lib/test_bench/controls/error.rb', line 48
def backtrace_locations
@backtrace_locations
end
|
Class Method Details
.backtrace_locations ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/test_bench/controls/error.rb', line 24
def self.backtrace_locations
[
BacktraceLocation.new(file, line, method_name),
BacktraceLocation.new(file, line + 1, method_name),
BacktraceLocation.new(file, line + 2, method_name),
]
end
|
.example ⇒ Object
4
5
6
|
# File 'lib/test_bench/controls/error.rb', line 4
def self.example
new backtrace_locations
end
|
.file ⇒ Object
8
9
10
|
# File 'lib/test_bench/controls/error.rb', line 8
def self.file
Path.example
end
|
.line ⇒ Object
12
13
14
|
# File 'lib/test_bench/controls/error.rb', line 12
def self.line
1
end
|
.message ⇒ Object
16
17
18
|
# File 'lib/test_bench/controls/error.rb', line 16
def self.message
'Some error'
end
|
.method_name ⇒ Object
20
21
22
|
# File 'lib/test_bench/controls/error.rb', line 20
def self.method_name
'some_method'
end
|
Instance Method Details
#backtrace ⇒ Object
54
55
56
|
# File 'lib/test_bench/controls/error.rb', line 54
def backtrace
backtrace_locations.map(&:to_s)
end
|
#to_s ⇒ Object
58
59
60
|
# File 'lib/test_bench/controls/error.rb', line 58
def to_s
self.class.message
end
|