spec/em-dextras/spec/spy_spec.rb in em-dextras-0.1.0 vs spec/em-dextras/spec/spy_spec.rb in em-dextras-0.2.0
- old
+ new
@@ -10,9 +10,20 @@
subject.called?(:bar, 1, :a => "b").should be_false
subject.called?(:foo, 1, :a => "c").should be_false
end
end
+ describe "default return value" do
+ it "returns nil if no default return value is defined" do
+ spy = EMDextras::Spec::Spy.new
+ spy.some_method.should == nil
+ end
+
+ it "returns the default value if defined" do
+ spy = EMDextras::Spec::Spy.new :default_return => "default"
+ spy.some_method.should == "default"
+ end
+ end
describe :received_call! do
it "should do nothing if the call was really received" do
EM.run do
subject.foo(1, :a => "b")