Skip to content
Browse files

Adds failing test for #fetch-ing false and nil values

  • Loading branch information...
1 parent 3d6a3de commit d97666772b0f16569526aea32d02fcb2aef3d537 @alindeman committed May 2, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/test_dalli.rb
View
14 test/test_dalli.rb
@@ -127,6 +127,20 @@
end
end
+ should "support the fetch operation with falsey values" do
+ memcached do |dc|
+ dc.flush
+
+ dc.set("fetch_key", false)
+ res = dc.fetch("fetch_key") { flunk "fetch block called" }
+ assert_equal false, res
+
+ dc.set("fetch_key", nil)
+ res = dc.fetch("fetch_key") { flunk "fetch block called" }
+ assert_equal nil, res
+ end
+ end
+
should "support the cas operation" do
memcached do |dc|
dc.flush

0 comments on commit d976667

Please sign in to comment.
Something went wrong with that request. Please try again.