Skip to content

Commit

Permalink
pending specs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Aug 20, 2010
1 parent dbc257e commit 4cd3f18
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
28 changes: 16 additions & 12 deletions spec/pickle/jar_spec.rb
Expand Up @@ -4,6 +4,10 @@
let(:model_class) { Class.new.tap {|c| c.stub!(:name).and_return('Module::ModelClass') } }
let(:model) { model_class.new }

describe "converting args to refs" do
it "should be possible"
end

shared_examples_for "after storing a model" do
specify "can be retrieved with Pickle::Ref.new(<model class name>)" do
subject.retrieve(Pickle::Ref.new('Module::ModelClass')).should == model
Expand Down Expand Up @@ -91,18 +95,6 @@
subject.store(model)
end

describe "the latest stored model" do
it_should_behave_like "after storing a model"

specify "can be retrieved with '3rd' in the pickle ref" do
subject.retrieve(Pickle::Ref.new("2nd module_model_class")).should == middle_model
end
end

specify "the earliest stored model can be retrieved with '2nd' in the pickle ref" do
subject.retrieve(Pickle::Ref.new("2nd module_model_class")).should == middle_model
end

specify "the earliest stored model can be retrieved with '1st' in the pickle ref" do
subject.retrieve(Pickle::Ref.new("1st module_model_class")).should == earliest_model
end
Expand All @@ -111,6 +103,18 @@
subject.retrieve(Pickle::Ref.new("first module_model_class")).should == earliest_model
end

specify "the model stored 2nd can be retrieved with '2nd' in the pickle ref" do
subject.retrieve(Pickle::Ref.new("2nd module_model_class")).should == middle_model
end

describe "the latest stored model" do
it_should_behave_like "after storing a model"

specify "can be retrieved with '3rd' in the pickle ref" do
subject.retrieve(Pickle::Ref.new("3rd module_model_class")).should == model
end
end

specify "attempting to retrieve the 4th model raises UnknownModelError" do
lambda { subject.retrieve(Pickle::Ref.new("4th module_model_class")) }.should raise_error(Pickle::Jar::UnknownModelError)
end
Expand Down
4 changes: 4 additions & 0 deletions spec/pickle/ref_spec.rb
Expand Up @@ -101,5 +101,9 @@
end
end
end

describe "creating with attrs hash" do
it "should be possible"
end
end

0 comments on commit 4cd3f18

Please sign in to comment.