cistern 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ class Cistern::Collection < Array
10
10
  end
11
11
  end
12
12
 
13
- %w[first last].each do |method|
13
+ %w[first last size count to_s].each do |method|
14
14
  define_method(method) do
15
15
  lazy_load unless @loaded
16
16
  super()
@@ -1,3 +1,3 @@
1
1
  module Cistern
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -13,6 +13,17 @@ describe "Cistern::Collection" do
13
13
  end
14
14
  end
15
15
 
16
+ it "should give to_s" do
17
+ collection = SampleCollection.new
18
+ collection.to_s.should_not eq "[]"
19
+ collection.to_s.gsub(/:[^>]*/,'').should == collection.all.to_s.gsub(/:[^>]*/,'')
20
+ end
21
+
22
+ it "should give size and count" do
23
+ SampleCollection.new.size.should == 3
24
+ SampleCollection.new.count.should == 3
25
+ end
26
+
16
27
  it "should give first" do
17
28
  SampleCollection.new.first.should == SampleCollectionModel.new(id: 1)
18
29
  end
@@ -32,4 +43,8 @@ describe "Cistern::Collection" do
32
43
  it "should slice" do
33
44
  SampleCollection.new.slice(0,2).should == [SampleCollectionModel.new(id: 1), SampleCollectionModel.new(id: 3, name: "tom")]
34
45
  end
46
+
47
+ it "should ==" do
48
+ SampleCollection.new.all == SampleCollection.new.all
49
+ end
35
50
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: cistern
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.2
5
+ version: 0.2.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Josh Lane
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-05 00:00:00.000000000 Z
12
+ date: 2013-07-17 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: API client framework extracted from Fog
15
15
  email:
@@ -72,3 +72,4 @@ test_files:
72
72
  - spec/collection_spec.rb
73
73
  - spec/model_spec.rb
74
74
  - spec/spec_helper.rb
75
+ has_rdoc: