Module: Muack::API
- Defined in:
- lib/muack.rb
Class Method Summary collapse
- .any_instance_of(klass) ⇒ Object
- .anything ⇒ Object
- .coat(obj = Object.new) ⇒ Object
- .hash_including(hash) ⇒ Object
- .including(element) ⇒ Object
- .is_a(klass) ⇒ Object
- .match(regexp) ⇒ Object
- .mock(obj = Object.new) ⇒ Object
- .respond_to(*msg) ⇒ Object
- .satisfy(&block) ⇒ Object
- .spy(obj) ⇒ Object
- .stub(obj = Object.new) ⇒ Object
- .within(range_or_array) ⇒ Object
Class Method Details
.any_instance_of(klass) ⇒ Object
44 45 46 47 |
# File 'lib/muack.rb', line 44 def any_instance_of klass ret = Muack.session.any_instance_of(klass) if block_given? then yield(ret) else ret end end |
.coat(obj = Object.new) ⇒ Object
34 35 36 37 |
# File 'lib/muack.rb', line 34 def coat obj=Object.new ret = Muack.session.coat(obj) if block_given? then yield(ret) else ret end end |
.hash_including(hash) ⇒ Object
61 62 63 |
# File 'lib/muack.rb', line 61 def hash_including hash Muack::HashIncluding.new(hash) end |
.including(element) ⇒ Object
65 66 67 |
# File 'lib/muack.rb', line 65 def including element Muack::Including.new(element) end |
.is_a(klass) ⇒ Object
49 50 51 |
# File 'lib/muack.rb', line 49 def is_a klass Muack::IsA.new(klass) end |
.match(regexp) ⇒ Object
57 58 59 |
# File 'lib/muack.rb', line 57 def match regexp Muack::Match.new(regexp) end |
.mock(obj = Object.new) ⇒ Object
24 25 26 27 |
# File 'lib/muack.rb', line 24 def mock obj=Object.new ret = Muack.session.mock(obj) if block_given? then yield(ret) else ret end end |
.respond_to(*msg) ⇒ Object
73 74 75 |
# File 'lib/muack.rb', line 73 def respond_to *msg Muack::RespondTo.new(*msg) end |
.satisfy(&block) ⇒ Object
77 78 79 |
# File 'lib/muack.rb', line 77 def satisfy &block Muack::Satisfy.new(block) end |
.spy(obj) ⇒ Object
39 40 41 42 |
# File 'lib/muack.rb', line 39 def spy obj ret = Muack.session.spy(obj) if block_given? then yield(ret) else ret end end |