Module: Ww::Double::Mock
- Defined in:
- lib/ww/double/mock.rb,
lib/ww/double/mock/expectation.rb
Defined Under Namespace
Classes: Expectation
Instance Method Summary collapse
- #expectations ⇒ Object
- #mock(args = nil, &block) ⇒ Object
- #testing_thread ⇒ Object
- #testing_thread=(thread) ⇒ Object
- #verify ⇒ Object
Instance Method Details
#expectations ⇒ Object
22 23 24 |
# File 'lib/ww/double/mock.rb', line 22 def expectations @expectations ||= [] end |
#mock(args = nil, &block) ⇒ Object
14 15 16 |
# File 'lib/ww/double/mock.rb', line 14 def mock(args = nil, &block) Dsl::MockDefinition.new(self, args, &block) end |
#testing_thread ⇒ Object
10 11 12 |
# File 'lib/ww/double/mock.rb', line 10 def testing_thread @testing_thread end |
#testing_thread=(thread) ⇒ Object
6 7 8 |
# File 'lib/ww/double/mock.rb', line 6 def testing_thread=(thread) @testing_thread = thread end |
#verify ⇒ Object
18 19 20 |
# File 'lib/ww/double/mock.rb', line 18 def verify raise MockError unless expectations.all? {|mock| mock.executed? } end |