Class: SeeingIsBelieving::Result
- Inherits:
-
Object
- Object
- SeeingIsBelieving::Result
- Includes:
- Enumerable, HasException, TracksLineNumbersSeen
- Defined in:
- lib/seeing_is_believing/result.rb
Constant Summary
Constants included from TracksLineNumbersSeen
TracksLineNumbersSeen::INITIAL_LINE_NUMBER
Instance Attribute Summary collapse
-
#bug_in_sib ⇒ Object
(also: #bug_in_sib?)
Returns the value of attribute bug_in_sib.
-
#exitstatus ⇒ Object
Returns the value of attribute exitstatus.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Attributes included from HasException
Instance Method Summary collapse
- #[](line_number) ⇒ Object
- #each(&block) ⇒ Object
- #has_stderr? ⇒ Boolean
- #has_stdout? ⇒ Boolean
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #record_exception(line_number, exception) ⇒ Object
- #record_result(line_number, value) ⇒ Object
Methods included from TracksLineNumbersSeen
#max_line_number, #min_line_number, #track_line_number
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
23 24 25 |
# File 'lib/seeing_is_believing/result.rb', line 23 def initialize @min_line_number = @max_line_number = 1 end |
Instance Attribute Details
#bug_in_sib ⇒ Object Also known as: bug_in_sib?
Returns the value of attribute bug_in_sib.
11 12 13 |
# File 'lib/seeing_is_believing/result.rb', line 11 def bug_in_sib @bug_in_sib end |
#exitstatus ⇒ Object
Returns the value of attribute exitstatus.
11 12 13 |
# File 'lib/seeing_is_believing/result.rb', line 11 def exitstatus @exitstatus end |
#stderr ⇒ Object
Returns the value of attribute stderr.
11 12 13 |
# File 'lib/seeing_is_believing/result.rb', line 11 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
11 12 13 |
# File 'lib/seeing_is_believing/result.rb', line 11 def stdout @stdout end |
Instance Method Details
#[](line_number) ⇒ Object
42 43 44 |
# File 'lib/seeing_is_believing/result.rb', line 42 def [](line_number) results(line_number) end |
#each(&block) ⇒ Object
46 47 48 |
# File 'lib/seeing_is_believing/result.rb', line 46 def each(&block) (min_line_number..max_line_number).each { |line_number| block.call self[line_number] } end |
#has_stderr? ⇒ Boolean
19 20 21 |
# File 'lib/seeing_is_believing/result.rb', line 19 def has_stderr? stderr && !stderr.empty? end |
#has_stdout? ⇒ Boolean
15 16 17 |
# File 'lib/seeing_is_believing/result.rb', line 15 def has_stdout? stdout && !stdout.empty? end |
#record_exception(line_number, exception) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/seeing_is_believing/result.rb', line 33 def record_exception(line_number, exception) recorded_exception = RecordedException.new exception.class.name, exception., exception.backtrace self.exception = recorded_exception track_line_number line_number results(line_number).exception = recorded_exception end |
#record_result(line_number, value) ⇒ Object
27 28 29 30 31 |
# File 'lib/seeing_is_believing/result.rb', line 27 def record_result(line_number, value) track_line_number line_number results(line_number) << value.inspect value end |