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.
246 247 248 249 |
# File 'lib/rspec/queue.rb', line 246 def initialize(example_group, example) @example_group = example_group @example = example end |
Instance Attribute Details
#example ⇒ Object (readonly)
Returns the value of attribute example.
244 245 246 |
# File 'lib/rspec/queue.rb', line 244 def example @example end |
#example_group ⇒ Object (readonly)
Returns the value of attribute example_group.
244 245 246 |
# File 'lib/rspec/queue.rb', line 244 def example_group @example_group end |
Instance Method Details
#<=>(other) ⇒ Object
255 256 257 |
# File 'lib/rspec/queue.rb', line 255 def <=>(other) id <=> other.id end |
#id ⇒ Object
251 252 253 |
# File 'lib/rspec/queue.rb', line 251 def id example.id end |
#run(reporter) ⇒ Object
259 260 261 262 263 264 |
# File 'lib/rspec/queue.rb', line 259 def run(reporter) instance = example_group.new(example.inspect_output) example_group.set_ivars(instance, example_group.before_context_ivars) result = example.run(instance, reporter) result.nil? ? true : result end |