Class: Mutant::Rspec::Strategy
- Inherits:
-
Strategy
- Object
- Strategy
- Mutant::Rspec::Strategy
- Defined in:
- lib/mutant/rspec/strategy.rb
Overview
Rspec killer strategy
Constant Summary collapse
- RSPEC_2_VERSION_PREFIX =
'2.'.freeze
Instance Method Summary collapse
-
#all_tests ⇒ Enumerable<Test>
private
Return all available tests.
-
#run(test) ⇒ Object
private
Return report for test.
-
#setup ⇒ self
private
Setup rspec strategy.
Instance Method Details
#all_tests ⇒ Enumerable<Test>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return all available tests
53 54 55 56 57 |
# File 'lib/mutant/rspec/strategy.rb', line 53 def all_tests example_groups.map do |example_group| Test.new(self, example_group) end end |
#run(test) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return report for test
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mutant/rspec/strategy.rb', line 32 def run(test) output = StringIO.new success = false reporter = new_reporter(output) reporter.report(1) do success = test.example_group.run(reporter) end output.rewind Test::Report.new( test: self, output: output.read, success: success ) end |
#setup ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Setup rspec strategy
19 20 21 22 23 |
# File 'lib/mutant/rspec/strategy.rb', line 19 def setup .configure(configuration) configuration.load_spec_files self end |