ruby_json_api_client 0.0.8 → 0.0.9
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 +4 -4
- data/lib/ruby_json_api_client/base.rb +5 -0
- data/lib/ruby_json_api_client/version.rb +1 -1
- data/spec/unit/base_spec.rb +28 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72cd1d75431c099d28561aef966ee1d89a8f6364
|
4
|
+
data.tar.gz: 4ef13bbf617f22b09e3fdcfa3ccbdffa66aec743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6d1457c4151ba98842f42ff8968238abe3b91161575c4b6c7df959c72ce9c26de9e54e4e43fe8166d842b0c46007e706dcd59c99bb336c9774eb113db7a9e42
|
7
|
+
data.tar.gz: 351f6cfd3131f5e542c8a980d49571bf22d843be432d6ab2908379bd53dbd7dfda04d045af16201bef1630d2042c1d4fe7df95fe19eb7b399b22d43c919d3f4b
|
data/spec/unit/base_spec.rb
CHANGED
@@ -120,4 +120,32 @@ describe RubyJsonApiClient::Base do
|
|
120
120
|
it { should eq(true) }
|
121
121
|
end
|
122
122
|
end
|
123
|
+
|
124
|
+
describe :hash do
|
125
|
+
context "two objects of different classes" do
|
126
|
+
subject { Person.new(id: 1).hash == Item.new(id: 1).hash }
|
127
|
+
it { should eq(true) }
|
128
|
+
end
|
129
|
+
|
130
|
+
context "two objects of the same class but different ids" do
|
131
|
+
subject { Person.new(id: 1).hash == Person.new(id: 2).hash }
|
132
|
+
it { should eq(false) }
|
133
|
+
end
|
134
|
+
|
135
|
+
context "two objects with the same klass and id" do
|
136
|
+
subject { Person.new(id: 1).hash == Person.new(id: 1).hash }
|
137
|
+
it { should eq(true) }
|
138
|
+
end
|
139
|
+
|
140
|
+
context "the same instance" do
|
141
|
+
let(:person) { Person.new(id: 1) }
|
142
|
+
subject { person.hash == person.hash }
|
143
|
+
it { should eq(true) }
|
144
|
+
end
|
145
|
+
|
146
|
+
context "two objects with non standard identifiers" do
|
147
|
+
subject { Thing.new(uuid: 'x').hash == Thing.new(uuid: 'x').hash }
|
148
|
+
it { should eq(true) }
|
149
|
+
end
|
150
|
+
end
|
123
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_json_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Toronto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -313,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
313
313
|
version: '0'
|
314
314
|
requirements: []
|
315
315
|
rubyforge_project:
|
316
|
-
rubygems_version: 2.
|
316
|
+
rubygems_version: 2.4.8
|
317
317
|
signing_key:
|
318
318
|
specification_version: 4
|
319
319
|
summary: API client for activemodel instances
|