Skip to content

Commit

Permalink
Jar#store takes a Pickle::Ref instead of options hash
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Aug 23, 2010
1 parent a7edebd commit 91a843c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions spec/pickle/jar_spec.rb
Expand Up @@ -4,10 +4,6 @@
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 All @@ -17,7 +13,7 @@
subject.retrieve(Pickle::Ref.new('module_model_class')).should == model
end

specify "can be retrieve with Pickle::Ref.new('last underscored_class_name')" do
specify "can be retrieved with Pickle::Ref.new('last underscored_class_name')" do
subject.retrieve(Pickle::Ref.new("last module_model_class")).should == model
end
end
Expand All @@ -42,7 +38,7 @@

describe "after storing a model with an optional factory," do
let(:factory) { 'factory' }
before { subject.store(model, :factory => factory) }
before { subject.store(model, Pickle::Ref.new(factory)) }

describe "the model" do
it_should_behave_like "after storing a model"
Expand All @@ -62,7 +58,7 @@

describe "after storing a model with an optional label," do
let(:label) { 'label' }
before { subject.store(model, :label => label) }
before { subject.store(model, Pickle::Ref.new('"label"')) }

describe "the model" do
it_should_behave_like "after storing a model"
Expand All @@ -72,8 +68,8 @@

describe "after storing two different models under the same label" do
before do
subject.store(model, :label => "fred", :factory => "factory")
subject.store(model_class.new, :label => "fred", :factory => "factory2")
subject.store(model, Pickle::Ref.new('factory "fred"'))
subject.store(model_class.new, Pickle::Ref.new('factory2 "fred"'))
end

specify "a model can be retrieved by factory and label" do
Expand Down
2 changes: 1 addition & 1 deletion spec/pickle/ref_spec.rb
Expand Up @@ -103,7 +103,7 @@
end

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

end
end

0 comments on commit 91a843c

Please sign in to comment.