Class: Cucumber::Filters::Randomizer
- Inherits:
-
Object
- Object
- Cucumber::Filters::Randomizer
- Defined in:
- lib/cucumber/filters/randomizer.rb
Overview
Batches up all test cases, randomizes them, and then sends them on
Instance Method Summary collapse
- #done ⇒ Object
-
#initialize(seed, receiver = nil) ⇒ Randomizer
constructor
A new instance of Randomizer.
- #test_case(test_case) ⇒ Object
- #with_receiver(receiver) ⇒ Object
Constructor Details
#initialize(seed, receiver = nil) ⇒ Randomizer
Returns a new instance of Randomizer.
9 10 11 12 13 |
# File 'lib/cucumber/filters/randomizer.rb', line 9 def initialize(seed, receiver = nil) @receiver = receiver @test_cases = [] @seed = seed end |
Instance Method Details
#done ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/cucumber/filters/randomizer.rb', line 20 def done shuffled_test_cases.each do |test_case| test_case.describe_to(@receiver) end @receiver.done self end |
#test_case(test_case) ⇒ Object
15 16 17 18 |
# File 'lib/cucumber/filters/randomizer.rb', line 15 def test_case(test_case) @test_cases << test_case self end |
#with_receiver(receiver) ⇒ Object
28 29 30 |
# File 'lib/cucumber/filters/randomizer.rb', line 28 def with_receiver(receiver) self.class.new(@seed, receiver) end |