Class: Bogus::Double

Inherits:
Object
  • Object
show all
Extended by:
Takes
Includes:
ProxiesMethodCalls
Defined in:
lib/bogus/stubbing/double.rb

Instance Method Summary collapse

Methods included from Takes

takes

Methods included from ProxiesMethodCalls

#proxy

Instance Method Details

#mockObject



21
22
23
# File 'lib/bogus/stubbing/double.rb', line 21

def mock
  proxy(:mocks)
end

#mocks(name, *args, &return_value) ⇒ Object



25
26
27
28
# File 'lib/bogus/stubbing/double.rb', line 25

def mocks(name, *args, &return_value)
  stubs(name, *args, &return_value)
  object.__shadow__.mocks(name, *args, &return_value)
end

#stubObject



9
10
11
# File 'lib/bogus/stubbing/double.rb', line 9

def stub
  proxy(:stubs)
end

#stubs(name, *args, &return_value) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/bogus/stubbing/double.rb', line 13

def stubs(name, *args, &return_value)
  verifies_stub_definition.verify!(object, name, args)
  double_tracker.track(object)
  records_double_interactions.record(object, name, args, &return_value)
  overwrites_methods.overwrite(object, name)
  object.__shadow__.stubs(name, *args, &return_value)
end