Class: RSpecRedo::Runner
- Inherits:
-
Object
- Object
- RSpecRedo::Runner
- Defined in:
- lib/rspec-redo/runner.rb
Instance Attribute Summary collapse
-
#redo_opts ⇒ Object
readonly
Returns the value of attribute redo_opts.
-
#retry_count ⇒ Object
Returns the value of attribute retry_count.
-
#rspec_opts ⇒ Object
readonly
Returns the value of attribute rspec_opts.
-
#total_retries ⇒ Object
readonly
Returns the value of attribute total_retries.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rspec_opts, redo_opts = {}) ⇒ Runner
constructor
A new instance of Runner.
- #invoke ⇒ Object
Constructor Details
#initialize(rspec_opts, redo_opts = {}) ⇒ Runner
Returns a new instance of Runner.
28 29 30 31 32 |
# File 'lib/rspec-redo/runner.rb', line 28 def initialize(rspec_opts, redo_opts = {}) @rspec_opts = rspec_opts @redo_opts = redo_opts @total_retries = @retry_count = redo_opts.fetch('retry-count', 1) end |
Instance Attribute Details
#redo_opts ⇒ Object (readonly)
Returns the value of attribute redo_opts.
26 27 28 |
# File 'lib/rspec-redo/runner.rb', line 26 def redo_opts @redo_opts end |
#retry_count ⇒ Object
Returns the value of attribute retry_count.
25 26 27 |
# File 'lib/rspec-redo/runner.rb', line 25 def retry_count @retry_count end |
#rspec_opts ⇒ Object (readonly)
Returns the value of attribute rspec_opts.
26 27 28 |
# File 'lib/rspec-redo/runner.rb', line 26 def rspec_opts @rspec_opts end |
#total_retries ⇒ Object (readonly)
Returns the value of attribute total_retries.
26 27 28 |
# File 'lib/rspec-redo/runner.rb', line 26 def total_retries @total_retries end |
Class Method Details
.invoke(args = ARGV.dup) ⇒ Object
6 7 8 9 |
# File 'lib/rspec-redo/runner.rb', line 6 def invoke(args = ARGV.dup) opts = extract!(args) new(args, opts).invoke end |
Instance Method Details
#invoke ⇒ Object
34 35 36 37 38 |
# File 'lib/rspec-redo/runner.rb', line 34 def invoke run # Invoke rspec for the first time rerun until $?.success? || retry_count.zero? abort! unless $?.success? end |