Class: FlexMock

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/applettestcase.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/arrow/applettestcase.rb', line 35

def method_missing(sym, *args, &block)
	mock_wrap do
		if handler = @expectations[sym]
			args << block  if block_given?
			handler.call(*args)
		else
			raise NoMethodError, "undefined method `%s' for %p" %
				[ sym, self ] unless @ignore_missing
		end
	end
end

Instance Method Details

#inspectObject



27
28
29
30
31
32
33
# File 'lib/arrow/applettestcase.rb', line 27

def inspect
	"#<%s:0x%x %s>" % [
		self.class.name,
		self.object_id * 2,
	 	self.mock_name
	]
end