lsv-plus 1.0.1 → 1.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: 69b3a27a69ebde28bfabe0588dc5c5f26688082a
4
- data.tar.gz: 214fce2bb0bf41faa17d60b3eb9e23b2db5e35b0
3
+ metadata.gz: 87b8fe170f603357b6a3f912437fd2a236a9f3f8
4
+ data.tar.gz: b962b4deed60a8d27e3ac5ae98b4eb5cd8a965df
5
5
  SHA512:
6
- metadata.gz: 46ea524d0634c0ebe5aa6fdc5bf6a601ac2b3b9f73ed29a0f88c989c1a1be879c1c41a29aae5858b567977ba1b6e5c679cf448335b00c711d317d5d57a79afe2
7
- data.tar.gz: e102129986881f542781548755a6319e3e86fbb6505d1342cdf1da69355550b33f4cdd9149d78ace1974a3e9cced06ff1120d1786dcbb6def2a11e2bb97a5ca9
6
+ metadata.gz: 9bcec36e1d580286c98c02ea5fd3ad09dc3c47c08803ebf34bcc0a447afc5c54f84c49e19bce3ea98bb44ce56b0e4718621a5fd8e7d71097d268b1a01c72ac9e
7
+ data.tar.gz: 3b6e90367977ed8bbcfccd05d1668e57d554e61c144680536a83083f93b331652768dc4d0d1449bec554393b84dfd7fc802bd068829f006a7fa30a5873524fec
@@ -56,6 +56,7 @@ module LSVplus
56
56
 
57
57
  def ==(other)
58
58
  ATTRIBUTES.each do |attribute|
59
+ return false unless other.respond_to?(attribute)
59
60
  return false unless send(attribute) == other.send(attribute)
60
61
  end
61
62
  true
@@ -1,3 +1,3 @@
1
1
  module LSVplus
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
data/spec/record_spec.rb CHANGED
@@ -61,6 +61,20 @@ RSpec.describe LSVplus::Record do
61
61
  end
62
62
 
63
63
  describe '#==' do
64
- specify { expect(LSVplus::Record.new(attributes)).to eq(LSVplus::Record.new(attributes)) }
64
+ context 'the same object type' do
65
+ context 'same attributes' do
66
+ specify { expect(LSVplus::Record.new(attributes)).to eq(LSVplus::Record.new(attributes)) }
67
+ end
68
+
69
+ context 'other attributes' do
70
+ specify do
71
+ expect(LSVplus::Record.new(attributes.merge(amount: 1))).to_not eq(LSVplus::Record.new(attributes))
72
+ end
73
+ end
74
+ end
75
+
76
+ context 'other object type' do
77
+ specify { expect(LSVplus::Record.new(attributes)).to_not eq(Object.new) }
78
+ end
65
79
  end
66
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lsv-plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raffael Schmid