Class: RSpec::Queue::SingleExample
- Inherits:
-
Object
- Object
- RSpec::Queue::SingleExample
- Defined in:
- lib/rspec/queue.rb
Instance Attribute Summary collapse
-
#example ⇒ Object
readonly
Returns the value of attribute example.
-
#example_group ⇒ Object
readonly
Returns the value of attribute example_group.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #id ⇒ Object
-
#initialize(example_group, example) ⇒ SingleExample
constructor
A new instance of SingleExample.
- #run(reporter) ⇒ Object
Constructor Details
#initialize(example_group, example) ⇒ SingleExample
Returns a new instance of SingleExample.
120 121 122 123 |
# File 'lib/rspec/queue.rb', line 120 def initialize(example_group, example) @example_group = example_group @example = example end |
Instance Attribute Details
#example ⇒ Object (readonly)
Returns the value of attribute example.
118 119 120 |
# File 'lib/rspec/queue.rb', line 118 def example @example end |
#example_group ⇒ Object (readonly)
Returns the value of attribute example_group.
118 119 120 |
# File 'lib/rspec/queue.rb', line 118 def example_group @example_group end |
Instance Method Details
#<=>(other) ⇒ Object
129 130 131 |
# File 'lib/rspec/queue.rb', line 129 def <=>(other) id <=> other.id end |
#id ⇒ Object
125 126 127 |
# File 'lib/rspec/queue.rb', line 125 def id example.id end |
#run(reporter) ⇒ Object
133 134 135 136 137 138 139 140 141 142 |
# File 'lib/rspec/queue.rb', line 133 def run(reporter) return if RSpec.world.wants_to_quit instance = example_group.new(example.inspect_output) example_group.set_ivars(instance, example_group.before_context_ivars) succeeded = example.run(instance, reporter) if !succeeded && reporter.fail_fast_limit_met? RSpec.world.wants_to_quit = true end succeeded end |