collabda 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13114a383a52ca5a6177a72200d820379bbfa5b5
4
- data.tar.gz: 40bd5d6768707b98d1c0d2b92be9a72b61025cb8
3
+ metadata.gz: 5cd0e6c3f84a72a8e1386265babb7e8ef6c3e5c4
4
+ data.tar.gz: 884e9eab33ff4ecc4c3775afc984f0661d8e83f0
5
5
  SHA512:
6
- metadata.gz: cbd2bbcc34f7c71b915cd5963dd62ffdeb74c2b159149f9dc61608e6c6c802d44440c484a1a656b7bfedc6ab426c39172ead16f088aa31c510d9cb99d47d8f91
7
- data.tar.gz: 10e0d034de14e5c6a29eeb036e0d3047db38999d2420d5d7ae3b69c84eee69986d3fd71b98f687ce1303580812c94d1d0f2ca82b4851587e0f862a5b63a77e4f
6
+ metadata.gz: 9b9cf21caec2d7f90a0543cae2a17ef6f790cf06404781ab7d94197acc5714b85bb076649e66b0408a89bd6bbc055b02dec342994fd0b7cdee2c5aac4f613ecf
7
+ data.tar.gz: f3a1ddf4c9ed02027906d5f7c5a10c1b01cf6570da0591da6ea1408d534795f8605482dba39ad0e87bc6269a9fa7c7687915d69ba220ea0b35ce0c7c78231f79
data/lib/collabda.rb CHANGED
@@ -65,6 +65,7 @@ module Collabda
65
65
  def build_collection
66
66
  check_validity
67
67
  fetch_data
68
+ @collabda_models = []
68
69
  @parsed_data.each do |el|
69
70
  self.new(el)
70
71
  end
@@ -119,6 +119,20 @@ describe "Collabda" do
119
119
  expect(model_class.first.description).to eq "yo foo"
120
120
  end
121
121
  end
122
+
123
+ context "rebuilding a collection" do
124
+ before(:each) do
125
+ Collabda.instance_variable_set(:"@classes",[model_class])
126
+ model_class.build_collection
127
+ end
128
+ it "calls build collection for each class" do
129
+ expect(model_class).to receive(:build_collection).once
130
+ Collabda.rebuild_collections
131
+ end
132
+ it "doesn't re-add existing collections" do
133
+ expect{Collabda.rebuild_collections}.not_to change{model_class.count}
134
+ end
135
+ end
122
136
  end
123
137
 
124
138
  describe "Json model" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collabda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Edwards-Jones