Class: RSpec::FlakeClassifier::ExampleHistory
- Inherits:
-
Object
- Object
- RSpec::FlakeClassifier::ExampleHistory
- Defined in:
- lib/rspec/flake/classifier/example_history.rb,
sig/rspec/flake/classifier.rbs
Instance Method Summary collapse
- #clear ⇒ void
-
#initialize ⇒ ExampleHistory
constructor
A new instance of ExampleHistory.
- #prior_examples ⇒ Array[String]
- #record(example) ⇒ void
Constructor Details
#initialize ⇒ ExampleHistory
Returns a new instance of ExampleHistory.
6 7 8 |
# File 'lib/rspec/flake/classifier/example_history.rb', line 6 def initialize @ids = [] end |
Instance Method Details
#clear ⇒ void
This method returns an undefined value.
19 20 21 |
# File 'lib/rspec/flake/classifier/example_history.rb', line 19 def clear @ids.clear end |
#prior_examples ⇒ Array[String]
10 11 12 |
# File 'lib/rspec/flake/classifier/example_history.rb', line 10 def prior_examples @ids.dup end |
#record(example) ⇒ void
This method returns an undefined value.
14 15 16 17 |
# File 'lib/rspec/flake/classifier/example_history.rb', line 14 def record(example) id = example.respond_to?(:id) ? example.id : nil @ids << id if id && !@ids.include?(id) end |