Class: SibaTest::KernelMock
- Inherits:
-
Object
- Object
- SibaTest::KernelMock
show all
- Defined in:
- lib/siba/helpers/test/kernel_mock.rb
Overview
mocks all Siba::SibaKernel methods
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/siba/helpers/test/kernel_mock.rb', line 7
def method_missing(meth, *args, &block)
if KernelMock.method_defined? meth
else
super
end
end
|
Class Attribute Details
.gets_return_value ⇒ Object
the valud ‘siba_kernel.gets’ method will return
26
27
28
|
# File 'lib/siba/helpers/test/kernel_mock.rb', line 26
def gets_return_value
@gets_return_value
end
|
Class Method Details
.mock_all_methods ⇒ Object
Instance Method Details
#respond_to?(meth) ⇒ Boolean
15
16
17
18
19
20
21
|
# File 'lib/siba/helpers/test/kernel_mock.rb', line 15
def respond_to?(meth)
if KernelMock.method_defined? meth
true
else
super
end
end
|