Class: Synthesis::MochaAdapter
Instance Method Summary
collapse
Methods inherited from Adapter
#fail_unless, #ignore_instances_of, inherited, #initialize, load
Methods included from Logging
#silence!, #speak!
Instance Method Details
#collect_expectations ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/synthesis/adapter/mocha.rb', line 14
def collect_expectations
ignore_instances_of Class::AnyInstance
Object.extend(ExpectationRecorder)
Object.record_expectations_on(:expects)
Mocha::Expectation.extend(ExpectationInterceptor)
Mocha::Expectation.intercept_test_subject_on(:invoke)
Mocha::Expectation.intercept_expected_arguments_on(:with)
Mocha::Expectation.intercept_expected_return_values_on(:returns)
Mocha::Expectation.intercept_expected_return_values_on(:raises)
Mocha::Expectation.remove_expectation_on(:never)
end
|
9
10
11
12
|
# File 'lib/synthesis/adapter/mocha.rb', line 9
def run
Test::Unit.run = true
fail_unless { Test::Unit::AutoRunner.run(false, nil, []) }
end
|
#stop_collecting_expectations ⇒ Object
26
27
28
29
|
# File 'lib/synthesis/adapter/mocha.rb', line 26
def stop_collecting_expectations
Mocha::Expectation.stop_intercepting!
Object.stop_recording!
end
|