Class: RspecN::Run
- Inherits:
-
Object
- Object
- RspecN::Run
- Defined in:
- lib/rspec_n/run.rb
Instance Attribute Summary collapse
-
#duration_seconds ⇒ Object
Returns the value of attribute duration_seconds.
-
#finish_time ⇒ Object
Returns the value of attribute finish_time.
-
#iteration ⇒ Object
Returns the value of attribute iteration.
-
#result_count_string ⇒ Object
Returns the value of attribute result_count_string.
-
#rspec_status ⇒ Object
Returns the value of attribute rspec_status.
-
#rspec_stderr ⇒ Object
Returns the value of attribute rspec_stderr.
-
#rspec_stdout ⇒ Object
Returns the value of attribute rspec_stdout.
-
#seed ⇒ Object
Returns the value of attribute seed.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#status_string ⇒ Object
Returns the value of attribute status_string.
Instance Method Summary collapse
- #failed? ⇒ Boolean
- #formatted_finish_time(format) ⇒ Object
- #formatted_start_time(format) ⇒ Object
- #go(command) ⇒ Object
- #has_warnings? ⇒ Boolean
-
#initialize(iteration:) ⇒ Run
constructor
A new instance of Run.
- #passed? ⇒ Boolean
- #skip ⇒ Object
- #skipped? ⇒ Boolean
- #start_clock ⇒ Object
- #stop_clock ⇒ Object
Constructor Details
#initialize(iteration:) ⇒ Run
Returns a new instance of Run.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rspec_n/run.rb', line 6 def initialize(iteration:) @duration_seconds = nil @finish_time = nil @has_warnings = nil @iteration = iteration @result_count_string = nil @rspec_stdout = nil @rspec_stderr = nil @rspec_status = nil @seed = nil @skipped = false @status_string = nil @start_time = nil end |
Instance Attribute Details
#duration_seconds ⇒ Object
Returns the value of attribute duration_seconds.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def duration_seconds @duration_seconds end |
#finish_time ⇒ Object
Returns the value of attribute finish_time.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def finish_time @finish_time end |
#iteration ⇒ Object
Returns the value of attribute iteration.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def iteration @iteration end |
#result_count_string ⇒ Object
Returns the value of attribute result_count_string.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def result_count_string @result_count_string end |
#rspec_status ⇒ Object
Returns the value of attribute rspec_status.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def rspec_status @rspec_status end |
#rspec_stderr ⇒ Object
Returns the value of attribute rspec_stderr.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def rspec_stderr @rspec_stderr end |
#rspec_stdout ⇒ Object
Returns the value of attribute rspec_stdout.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def rspec_stdout @rspec_stdout end |
#seed ⇒ Object
Returns the value of attribute seed.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def seed @seed end |
#start_time ⇒ Object
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def start_time @start_time end |
#status_string ⇒ Object
Returns the value of attribute status_string.
3 4 5 |
# File 'lib/rspec_n/run.rb', line 3 def status_string @status_string end |
Instance Method Details
#failed? ⇒ Boolean
63 64 65 |
# File 'lib/rspec_n/run.rb', line 63 def failed? @status_string == "Fail" end |
#formatted_finish_time(format) ⇒ Object
42 43 44 |
# File 'lib/rspec_n/run.rb', line 42 def formatted_finish_time(format) finish_time.strftime(format) end |
#formatted_start_time(format) ⇒ Object
38 39 40 |
# File 'lib/rspec_n/run.rb', line 38 def formatted_start_time(format) start_time.strftime(format) end |
#go(command) ⇒ Object
34 35 36 |
# File 'lib/rspec_n/run.rb', line 34 def go(command) @rspec_stdout, @rspec_stderr, @rspec_status = Open3.capture3(command) end |
#has_warnings? ⇒ Boolean
46 47 48 |
# File 'lib/rspec_n/run.rb', line 46 def has_warnings? @has_warnings end |
#passed? ⇒ Boolean
50 51 52 |
# File 'lib/rspec_n/run.rb', line 50 def passed? @status_string == "Pass" end |
#skip ⇒ Object
54 55 56 57 |
# File 'lib/rspec_n/run.rb', line 54 def skip @skipped = true @duration_seconds = 0 end |
#skipped? ⇒ Boolean
59 60 61 |
# File 'lib/rspec_n/run.rb', line 59 def skipped? @skipped end |
#start_clock ⇒ Object
21 22 23 |
# File 'lib/rspec_n/run.rb', line 21 def start_clock @start_time = Time.now end |
#stop_clock ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/rspec_n/run.rb', line 25 def stop_clock @finish_time = Time.now finalize_duration_seconds finalize_seed finalize_status_string finalize_result_count_string finalize_has_warnings end |