spec/spec.matchers.js in visionmedia-jspec-2.7.0 vs spec/spec.matchers.js in visionmedia-jspec-2.7.1
- old
+ new
@@ -360,11 +360,42 @@
it 'should pass with negation with times'
personWithPets.should.not.receive('addPets', 'twice')
personWithPets.addPets('izzy')
end
-
+
+ it 'should pass with boolean args'
+ foo = { bar : function(arg){ return arg }}
+ foo.should.receive('bar', 'twice').with_args(true)
+ foo.bar(true)
+ foo.bar(true)
+ end
+
+ it 'should pass with null args'
+ foo = { bar : function(arg){ return arg }}
+ foo.should.receive('bar').with_args(null)
+ foo.bar(null)
+ end
+
+ it 'should pass with boolean return value true'
+ foo = { bar : function(){ return true }}
+ foo.should.receive('bar').and_return(true)
+ foo.bar()
+ end
+
+ it 'should pass with boolean return value false'
+ foo = { bar : function(){ return false }}
+ foo.should.receive('bar').and_return(false)
+ foo.bar()
+ end
+
+ it 'should pass with null return value'
+ foo = { bar : function(){ return null }}
+ foo.should.receive('bar').and_return(null)
+ foo.bar()
+ end
+
it 'should fail when the method does not exist'
person.should.receive('getPets')
end
it 'should fail when the method is never invoked'
@@ -429,9 +460,27 @@
it 'should fail with negation with times'
personWithPets.should.not.receive('addPets', 'twice')
personWithPets.addPets('izzy')
personWithPets.addPets('max')
+ end
+
+ it 'should fail with boolean args'
+ foo = { bar : function(arg){ return arg }}
+ foo.should.receive('bar').with_args(true)
+ foo.bar(false)
+ end
+
+ it 'should fail with boolean return value true'
+ foo = { bar : function(){ return true }}
+ foo.should.receive('bar').and_return(false)
+ foo.bar()
+ end
+
+ it 'should fail with boolean return value false'
+ foo = { bar : function(){ return false }}
+ foo.should.receive('bar').and_return(true)
+ foo.bar()
end
end
end
\ No newline at end of file