Skip to content

Commit

Permalink
Specs for alternate read/write methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Nov 7, 2012
1 parent ffd9785 commit 57f8460
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/adapter/spec/an_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 57f8460

Please sign in to comment.