Module: Crispy
- Defined in:
- lib/crispy.rb,
lib/crispy/version.rb,
lib/crispy/crispy_world.rb,
lib/crispy/crispy_internal/spy.rb,
lib/crispy/crispy_internal/double.rb,
lib/crispy/crispy_received_message.rb,
lib/crispy/crispy_internal/spy_base.rb,
lib/crispy/crispy_internal/class_spy.rb,
lib/crispy/crispy_internal/const_changer.rb,
lib/crispy/crispy_received_message_with_receiver.rb
Defined Under Namespace
Modules: CrispyInternal, CrispyWorld
Classes: CrispyReceivedMessage, CrispyReceivedMessageWithReceiver
Constant Summary
collapse
- VERSION =
"0.3.2"
Class Method Summary
collapse
Class Method Details
.double(name_or_stubs_map = nil, stubs_map = {}) ⇒ Object
16
17
18
|
# File 'lib/crispy.rb', line 16
def double name_or_stubs_map = nil, stubs_map = {}
::Crispy::CrispyInternal::Double.new name_or_stubs_map, stubs_map
end
|
.spied?(object) ⇒ Boolean
38
39
40
|
# File 'lib/crispy.rb', line 38
def spied? object
defined? object.__CRISPY_SPY__
end
|
.spied_instances?(klass) ⇒ Boolean
.spy(object) ⇒ Object
25
26
27
|
# File 'lib/crispy.rb', line 25
def spy object
object.__CRISPY_SPY__
end
|
.spy_into(object, stubs_map = {}) ⇒ Object
Returns a Spy object to wrap all methods of the object.
12
13
14
|
# File 'lib/crispy.rb', line 12
def spy_into object, stubs_map = {}
::Crispy::CrispyInternal::Spy.new object, stubs_map
end
|
.spy_into_instances(klass, stubs_map = {}) ⇒ Object
Make and returns a Crispy::ClassSpy’s instance to spy all instances of a class.
.spy_of_instances(klass) ⇒ Object
.stub_const(full_const_name, value) ⇒ Object