Permalink
Browse files

Specs for alternate read/write methods.

  • Loading branch information...
1 parent ffd9785 commit 57f84601c4b9f4e35df4e4952ed958d4c8cb6983 @jnunemaker committed Nov 7, 2012
Showing with 25 additions and 0 deletions.
  1. +25 −0 lib/adapter/spec/an_adapter.rb
@@ -31,6 +31,17 @@
end
end
+ describe "#get" do
+ it "returns nil if key not available" do
+ adapter.get(key).should be_nil
+ end
+
+ it "returns value if key available" do
+ adapter.write(key, attributes)
+ adapter.get(key).should eq(attributes)
+ end
+ end
+
describe "#[]" do
it "returns nil if key not available" do
adapter[key].should be_nil
@@ -119,6 +130,20 @@
end
end
+ describe "#set" do
+ it "sets key to value" do
+ adapter.set(key, attributes)
+ adapter.read(key).should eq(attributes)
+ end
+ end
+
+ describe "#[]=" do
+ it "sets key to value" do
+ adapter[key] = attributes
+ adapter.read(key).should eq(attributes)
+ end
+ end
+
describe "#delete" do
context "when key available" do
before do

0 comments on commit 57f8460

Please sign in to comment.