attr_extras 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/attr_extras.rb +1 -1
- data/lib/attr_extras/version.rb +1 -1
- data/spec/attr_extras_spec.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a73dba01ae15a21f182bf0f75ba144f53894ad3
|
4
|
+
data.tar.gz: 04674763cf6c41bf2ae1e6209ff74c317a8b645d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 584bd69b6af78936a1d33c000690357356b71c18d7f7203faa1834a83e9373a29f9c2729c962c415c2bb662aa3a0852cc9133fe61b4fc816a3e1072d7a9c8507
|
7
|
+
data.tar.gz: 23b28d7605848caae757fa3c8bcc88200a24e531a58034b30ba08eee71da6238f3c4a1362dd01ffd5bee8e4a9f1c3d3f9144a4286fdcd540e56c5ba380de7047
|
data/lib/attr_extras.rb
CHANGED
data/lib/attr_extras/version.rb
CHANGED
data/spec/attr_extras_spec.rb
CHANGED
@@ -219,22 +219,30 @@ describe Object, ".attr_value" do
|
|
219
219
|
attr_initialize :foo
|
220
220
|
attr_value :foo
|
221
221
|
end
|
222
|
+
klass2 = Class.new do
|
223
|
+
attr_initialize :foo
|
224
|
+
attr_value :foo
|
225
|
+
end
|
222
226
|
|
223
227
|
example1 = klass.new("Foo")
|
224
228
|
example2 = klass.new("Foo")
|
225
229
|
example3 = klass.new("Bar")
|
230
|
+
example4 = klass2.new("Foo")
|
226
231
|
|
227
232
|
example1.hash.must_equal example2.hash
|
228
233
|
example1.hash.wont_equal example3.hash
|
234
|
+
example1.hash.wont_equal example4.hash
|
229
235
|
|
230
236
|
assert example1.eql?(example2), "Examples should be 'eql?'"
|
231
|
-
refute
|
237
|
+
refute example1.eql?(example3), "Examples should not be 'eql?'"
|
238
|
+
refute example1.eql?(example4), "Examples should not be 'eql?'"
|
232
239
|
|
233
|
-
Set[example1, example2, example3].length.must_equal
|
240
|
+
Set[example1, example2, example3, example4].length.must_equal 3
|
234
241
|
|
235
242
|
hash = {}
|
236
243
|
hash[example1] = :awyeah
|
237
244
|
hash[example3] = :wat
|
245
|
+
hash[example4] = :nooooo
|
238
246
|
hash[example2].must_equal :awyeah
|
239
247
|
end
|
240
248
|
end
|