Class: DeepTest::Spec::WorkUnit
- Inherits:
-
Object
- Object
- DeepTest::Spec::WorkUnit
- Defined in:
- lib/deep_test/spec/work_unit.rb
Defined Under Namespace
Classes: ResultReporter
Instance Method Summary collapse
-
#initialize(identifier) ⇒ WorkUnit
constructor
A new instance of WorkUnit.
- #run ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(identifier) ⇒ WorkUnit
Returns a new instance of WorkUnit.
4 5 6 |
# File 'lib/deep_test/spec/work_unit.rb', line 4 def initialize(identifier) @identifier = identifier end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/deep_test/spec/work_unit.rb', line 8 def run # Dup options here to avoid clobbering the reporter on someone # elses options reference (Such as ExampleGroupRunner) = ::Spec::Runner. ::Spec::Runner.use ::Spec::Runner..dup ::Spec::Runner..reporter = ResultReporter.new(@identifier) result = run_without_deadlock_protection result = run_without_deadlock_protection if result.failed_due_to_deadlock? result = result.deadlock_result if result.failed_due_to_deadlock? result ensure ::Spec::Runner.use end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/deep_test/spec/work_unit.rb', line 22 def to_s "#{@identifier.group_description}: #{@identifier.description}" end |