class DeepTest::Spec::WorkUnit
Public Class Methods
new(identifier)
click to toggle source
# File lib/deep_test/spec/work_unit.rb, line 4 def initialize(identifier) @identifier = identifier end
Public Instance Methods
run()
click to toggle source
# 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) original_options = ::Spec::Runner.options ::Spec::Runner.use ::Spec::Runner.options.dup ::Spec::Runner.options.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 original_options end
to_s()
click to toggle source
# File lib/deep_test/spec/work_unit.rb, line 22 def to_s "#{@identifier.group_description}: #{@identifier.description}" end
Protected Instance Methods
run_without_deadlock_protection()
click to toggle source
# File lib/deep_test/spec/work_unit.rb, line 28 def run_without_deadlock_protection output = capture_stdout do ::Spec::Runner.options.run_one_example(@identifier) end ::Spec::Runner.options.reporter.result(output) end