Class: RSpec::Contracts::Proxy

Inherits:
Mocks::Proxy
  • Object
show all
Defined in:
lib/rspec/contracts/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(object, order_group, interface_name) ⇒ Proxy

Returns a new instance of Proxy.



7
8
9
10
# File 'lib/rspec/contracts/proxy.rb', line 7

def initialize(object, order_group, interface_name)
  @interface_name = interface_name
  super(object, order_group)
end

Instance Method Details

#add_message_expectation(location, method_name, opts = {}, &block) ⇒ Object



22
23
24
25
# File 'lib/rspec/contracts/proxy.rb', line 22

def add_message_expectation(location, method_name, opts={}, &block)
  create_requirement method_name
  super
end

#add_simple_stub(method_name, *args) ⇒ Object



17
18
19
20
# File 'lib/rspec/contracts/proxy.rb', line 17

def add_simple_stub(method_name, *args)
  create_requirement method_name, :return_value => args.first
  super
end

#add_stub(location, method_name, opts = {}, &implementation) ⇒ Object



12
13
14
15
# File 'lib/rspec/contracts/proxy.rb', line 12

def add_stub(location, method_name, opts={}, &implementation)
  create_requirement method_name
  super
end

#create_requirement(method_name, options = {}) ⇒ Object



27
28
29
# File 'lib/rspec/contracts/proxy.rb', line 27

def create_requirement(method_name, options = {})
  Requirement.create @interface_name, method_name, options
end