nano-store 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nano_store/bag.rb +4 -0
- data/lib/nano_store/version.rb +1 -1
- data/spec/bag_spec.rb +15 -0
- metadata +1 -1
data/lib/nano_store/bag.rb
CHANGED
data/lib/nano_store/version.rb
CHANGED
data/spec/bag_spec.rb
CHANGED
@@ -63,4 +63,19 @@ describe NanoStore::Bag do
|
|
63
63
|
bag.saved.count.should.be == 1
|
64
64
|
end
|
65
65
|
|
66
|
+
it "should add bag to store" do
|
67
|
+
before_count = NanoStore.shared_store.bags.count
|
68
|
+
|
69
|
+
bag = Bag.bag
|
70
|
+
NanoStore.shared_store.addObject(bag, error:nil)
|
71
|
+
|
72
|
+
# use << method to add object to bag
|
73
|
+
page = Page.new
|
74
|
+
page.text = "Hello"
|
75
|
+
page.index = 1
|
76
|
+
bag << page
|
77
|
+
|
78
|
+
bag.save
|
79
|
+
NanoStore.shared_store.bags.count.should.be == before_count + 1
|
80
|
+
end
|
66
81
|
end
|