Permalink
Browse files

Delete no longer returns anything of meaning.

  • Loading branch information...
1 parent f298ed2 commit 9d115fe96e90761c053abb94c0d8f0b3c859e4b4 @jnunemaker committed Nov 7, 2012
Showing with 17 additions and 8 deletions.
  1. +17 −8 lib/adapter/spec/an_adapter.rb
@@ -8,13 +8,15 @@
let(:attributes) {
{
- :one => 'one',
+ :one => 'one',
+ :three => 'three',
}
}
let(:attributes2) {
{
- :two => 'two',
+ :two => 'two',
+ :four => 'four',
}
}
@@ -93,14 +95,21 @@
end
describe "#delete" do
- it "removes stored key from store and returns value" do
- adapter.write(key, attributes)
- adapter.delete(key).should eq(attributes)
- adapter.key?(key).should be_false
+ context "when key available" do
+ before do
+ adapter.write(key, attributes)
+ @result = adapter.delete(key)
+ end
+
+ it "removes key" do
+ adapter.key?(key).should be_false
+ end
end
- it "returns nil when key not stored" do
- adapter.delete(key).should be_nil
+ context "when key not available" do
+ it "does not complain" do
+ adapter.delete(key)
+ end
end
end

0 comments on commit 9d115fe

Please sign in to comment.