Class: NumericMockObject

Inherits:
Numeric show all
Defined in:
lib/extensions/mspec/mspec/mocks/proxy.rb

Instance Method Summary collapse

Methods inherited from Numeric

#abs, #div, #divmod, #floor, #integer?, #modulo, #nonzero?, #remainder, #zero?

Methods included from Comparable

#<, #<=, #==, #>, #>=, #between?

Constructor Details

#initialize(name, options = {}) ⇒ NumericMockObject

Returns a new instance of NumericMockObject.



14
15
16
17
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 14

def initialize(name, options={})
  @name = name
  @null = options[:null_object]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



19
20
21
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 19

def method_missing(sym, *args, &block)
  @null ? self : super
end

Instance Method Details

#singleton_method_added(val) ⇒ Object



23
24
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 23

def singleton_method_added(val)
end