Class: Lookout::Stub::Methods

Inherits:
Object
  • Object
show all
Defined in:
lib/lookout/stub/methods.rb

Direct Known Subclasses

Mock::Methods

Instance Method Summary collapse

Constructor Details

#initializeMethods

Returns a new instance of Methods.



4
5
6
# File 'lib/lookout/stub/methods.rb', line 4

def initialize
  @methods = []
end

Instance Method Details

#define(object, method, &body) ⇒ Object



8
9
10
# File 'lib/lookout/stub/methods.rb', line 8

def define(object, method, &body)
  Lookout::Stub::Method.new(object, method, &body).define.tap{ |m| @methods << m }
end

#undefineObject



12
13
14
15
16
17
# File 'lib/lookout/stub/methods.rb', line 12

def undefine
  @methods.each do |method|
    method.undefine
  end
  self
end