Skip to content

Commit

Permalink
Adds failing test for #fetch-ing false and nil values
Browse files Browse the repository at this point in the history
  • Loading branch information
alindeman committed May 2, 2012
1 parent 3d6a3de commit d976667
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/test_dalli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d976667

Please sign in to comment.