Class: RSpecRedo::RakeTask
- Inherits:
-
RSpec::Core::RakeTask
- Object
- RSpec::Core::RakeTask
- RSpecRedo::RakeTask
- Defined in:
- lib/rspec-redo/rake_task.rb
Constant Summary collapse
- RSPEC_REDO_PATH =
File.('../../../bin/rspec-redo', __FILE__)
Instance Attribute Summary collapse
-
#retry_count ⇒ Object
Returns the value of attribute retry_count.
Instance Method Summary collapse
-
#initialize(name = 'spec:redo', *args, &block) ⇒ RakeTask
constructor
A new instance of RakeTask.
-
#rspec_opts ⇒ Object
Include the retry_count if it’s provided.
-
#rspec_path ⇒ Object
Swap out RSpec for the Redo CLI.
Constructor Details
#initialize(name = 'spec:redo', *args, &block) ⇒ RakeTask
Returns a new instance of RakeTask.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rspec-redo/rake_task.rb', line 9 def initialize(name = 'spec:redo', *args, &block) @retry_count = ENV['RETRY_COUNT'] unless ::Rake.application.last_description desc 'Run RSpec code examples with RSpecRedo' end super(name, :retry_count, *args) do |t, opts| @retry_count = opts.retry_count yield self if block_given? end end |
Instance Attribute Details
#retry_count ⇒ Object
Returns the value of attribute retry_count.
7 8 9 |
# File 'lib/rspec-redo/rake_task.rb', line 7 def retry_count @retry_count end |
Instance Method Details
#rspec_opts ⇒ Object
Include the retry_count if it’s provided
30 31 32 33 |
# File 'lib/rspec-redo/rake_task.rb', line 30 def rspec_opts return super unless retry_count [*super, '--retry-count', retry_count] end |
#rspec_path ⇒ Object
Swap out RSpec for the Redo CLI
24 25 26 |
# File 'lib/rspec-redo/rake_task.rb', line 24 def rspec_path RSPEC_REDO_PATH end |