Module: Muack::API
- Defined in:
- lib/muack.rb
Class Method Summary collapse
- .any_instance_of(klass) ⇒ Object
- .anything ⇒ Object
- .hash_including(hash) ⇒ Object
- .is_a(klass) ⇒ Object
- .match(regexp) ⇒ Object
- .mock(obj = Object.new) ⇒ Object
- .mock_proxy(obj = Object.new) ⇒ Object
- .satisfy(&block) ⇒ Object
- .stub(obj = Object.new) ⇒ Object
- .stub_proxy(obj = Object.new) ⇒ Object
- .within(range_or_array) ⇒ Object
Class Method Details
.any_instance_of(klass) ⇒ Object
43 44 45 46 |
# File 'lib/muack.rb', line 43 def any_instance_of klass ret = Muack.session.any_instance_of(klass) if block_given? then yield(ret) else ret end end |
.hash_including(hash) ⇒ Object
60 61 62 |
# File 'lib/muack.rb', line 60 def hash_including hash Muack::HashIncluding.new(hash) end |
.is_a(klass) ⇒ Object
48 49 50 |
# File 'lib/muack.rb', line 48 def is_a klass Muack::IsA.new(klass) end |
.match(regexp) ⇒ Object
56 57 58 |
# File 'lib/muack.rb', line 56 def match regexp Muack::Match.new(regexp) end |
.mock(obj = Object.new) ⇒ Object
23 24 25 26 |
# File 'lib/muack.rb', line 23 def mock obj=Object.new ret = Muack.session.mock(obj) if block_given? then yield(ret) else ret end end |
.mock_proxy(obj = Object.new) ⇒ Object
33 34 35 36 |
# File 'lib/muack.rb', line 33 def mock_proxy obj=Object.new ret = Muack.session.mock_proxy(obj) if block_given? then yield(ret) else ret end end |
.satisfy(&block) ⇒ Object
68 69 70 |
# File 'lib/muack.rb', line 68 def satisfy &block Muack::Satisfy.new(block) end |
.stub(obj = Object.new) ⇒ Object
28 29 30 31 |
# File 'lib/muack.rb', line 28 def stub obj=Object.new ret = Muack.session.stub(obj) if block_given? then yield(ret) else ret end end |