Class: RspecStarterStep
- Inherits:
-
Object
- Object
- RspecStarterStep
- Defined in:
- lib/rspec_starter/step.rb
Overview
RspecStarterStep is essentially an abstract super class. It should not be instantiated directly. It primarily holds the logic for executing a Task or Command. Steps (and their subclasses) maintain three different types of options.
1. Command Options - These are specified on the command line when the bin/start_rspec command is run.
2. Step Options - These are specified inside the bin/start_rspec file when a task or command is added to the step list.
3. Step Defaults - Steps define default values when Command Options or Step Options are not given.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#exit_status ⇒ Object
Returns the value of attribute exit_status.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
-
#run_time ⇒ Object
Returns the value of attribute run_time.
-
#runner ⇒ Object
Returns the value of attribute runner.
-
#successful ⇒ Object
(also: #successful?)
Returns the value of attribute successful.
Class Method Summary collapse
-
.default_quiet ⇒ Object
Most subclasses will suppress output when they run.
-
.default_stop_on_problem ⇒ Object
Most subclasses will prefer to stop rspec_starter if they hit a problem.
- .provide_options_to(registrar) ⇒ Object
-
.register_options ⇒ Object
Tasks can implement this method and register options that they support.
Instance Method Summary collapse
- #failed? ⇒ Boolean
- #helpers ⇒ Object
-
#initialize(id, runner, options) ⇒ RspecStarterStep
constructor
A new instance of RspecStarterStep.
- #quiet? ⇒ Boolean
- #run ⇒ Object
- #should_skip? ⇒ Boolean
- #stop_on_problem? ⇒ Boolean
- #verbose? ⇒ Boolean
Constructor Details
#initialize(id, runner, options) ⇒ RspecStarterStep
Returns a new instance of RspecStarterStep.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rspec_starter/step.rb', line 11 def initialize(id, runner, ) @id = id initialize_name @runner = runner @options = @start_time = nil @finish_time = nil @run_time = nil @exit_status = nil @successful = nil # This is set when the step runs @starting_message = nil end |
Instance Attribute Details
#exit_status ⇒ Object
Returns the value of attribute exit_status.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def exit_status @exit_status end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def @options end |
#quiet ⇒ Object
Returns the value of attribute quiet.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def quiet @quiet end |
#run_time ⇒ Object
Returns the value of attribute run_time.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def run_time @run_time end |
#runner ⇒ Object
Returns the value of attribute runner.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def runner @runner end |
#successful ⇒ Object Also known as: successful?
Returns the value of attribute successful.
7 8 9 |
# File 'lib/rspec_starter/step.rb', line 7 def successful @successful end |
Class Method Details
.default_quiet ⇒ Object
Most subclasses will suppress output when they run.
72 73 74 |
# File 'lib/rspec_starter/step.rb', line 72 def self.default_quiet true end |
.default_stop_on_problem ⇒ Object
Most subclasses will prefer to stop rspec_starter if they hit a problem.
77 78 79 |
# File 'lib/rspec_starter/step.rb', line 77 def self.default_stop_on_problem true end |
.provide_options_to(registrar) ⇒ Object
27 28 29 30 |
# File 'lib/rspec_starter/step.rb', line 27 def self.(registrar) @options_registrar = registrar end |
.register_options ⇒ Object
Tasks can implement this method and register options that they support.
33 34 |
# File 'lib/rspec_starter/step.rb', line 33 def self. end |
Instance Method Details
#failed? ⇒ Boolean
48 49 50 |
# File 'lib/rspec_starter/step.rb', line 48 def failed? !@successful end |
#helpers ⇒ Object
56 57 58 |
# File 'lib/rspec_starter/step.rb', line 56 def helpers RspecStarter.helpers end |
#quiet? ⇒ Boolean
40 41 42 |
# File 'lib/rspec_starter/step.rb', line 40 def quiet? .quiet end |
#run ⇒ Object
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/rspec_starter/step.rb', line 60 def run set_start_time execute_step set_finish_time set_run_time write_run_time handle_step_failure end |
#should_skip? ⇒ Boolean
36 37 38 |
# File 'lib/rspec_starter/step.rb', line 36 def should_skip? false end |
#stop_on_problem? ⇒ Boolean
44 45 46 |
# File 'lib/rspec_starter/step.rb', line 44 def stop_on_problem? .stop_on_problem end |
#verbose? ⇒ Boolean
52 53 54 |
# File 'lib/rspec_starter/step.rb', line 52 def verbose? !quiet? end |