protip 0.10.5 → 0.10.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50e4538f142042bcdbcc5c29e46b3a268b9fef04
4
- data.tar.gz: 7aaf2a518c3d4c1653f1abba85f7e2edda56dd90
3
+ metadata.gz: bbafb63f09c98b4e08843c2d8766bed6fec8aebe
4
+ data.tar.gz: bef3aa7d77fca8a813e3fba56194303ae626b7b1
5
5
  SHA512:
6
- metadata.gz: 5bed8237bc75b66a1b95189945e9e567efa83d335a4f18f8329052202a3851f32198617e7baa67a514a2e57190ce15a699f97f2726db3cf538c12d38581de7e9
7
- data.tar.gz: 06aeb09d06e2596c604c8234381963838b69ea4e7594821cdc86324f9111c0479cb481533f746085ee74efc673f8bf4055bec9f2e7f18b4306bb79fda812f941
6
+ metadata.gz: 35b8f01c76f8ddb6cbd7342a6043ea1d590b9753fe74067da416602593289ceeecb869fbebd5d31df1b50b7c97eb5f91941b99e2b643da4d40fbfdc799d59ec3
7
+ data.tar.gz: 1d7464462a49f72d1d77745e808f60ddae60b126c1ab75f302f1ffb0fe4dba7a30969353c6b6c9d9458d80af601c19a3e4ee3e797a1a0e6833b6564295fa348b
@@ -110,7 +110,7 @@ module Protip
110
110
  end
111
111
 
112
112
  def ==(wrapper)
113
- message == wrapper.message && converter == wrapper.converter
113
+ wrapper.is_a?(self.class) && message == wrapper.message && converter == wrapper.converter
114
114
  end
115
115
 
116
116
  private
@@ -133,6 +133,34 @@ module Protip::WrapperTest # namespace for internal constants
133
133
  end
134
134
  end
135
135
 
136
+ describe '#==' do
137
+ it 'returns false for non-wrapper objects' do
138
+ refute_equal 1, wrapper
139
+ refute_equal wrapper, 1 # Sanity check, make sure we're testing both sides of equality
140
+ end
141
+
142
+ it 'returns false when messages are not equal' do
143
+ alternate_message = Message.new
144
+ refute_equal alternate_message, wrapped_message # Sanity check
145
+ refute_equal wrapper, Protip::Wrapper.new(alternate_message, converter)
146
+ end
147
+
148
+ it 'returns false when converters are not equal' do
149
+ alternate_converter = Class.new do
150
+ include Protip::Converter
151
+ end.new
152
+ refute_equal alternate_converter, converter # Sanity check
153
+ refute_equal wrapper, Protip::Wrapper.new(wrapped_message, alternate_converter)
154
+ end
155
+
156
+ it 'returns true when the message and converter are equal' do
157
+ # Stub converter equality so we aren't relying on actual equality behavior there
158
+ alternate_converter = converter.clone
159
+ converter.expects(:==).at_least_once.with(alternate_converter).returns(true)
160
+ assert_equal wrapper, Protip::Wrapper.new(wrapped_message.clone, converter)
161
+ end
162
+ end
163
+
136
164
  describe '#get' do
137
165
  it 'does not convert simple fields' do
138
166
  converter.expects(:convertible?).never
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - AngelList
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -54,16 +54,22 @@ dependencies:
54
54
  name: protobuf
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 3.0.0
60
+ - - "<="
58
61
  - !ruby/object:Gem::Version
59
- version: '3.5'
62
+ version: 3.5.0
60
63
  type: :runtime
61
64
  prerelease: false
62
65
  version_requirements: !ruby/object:Gem::Requirement
63
66
  requirements:
64
- - - "~>"
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 3.0.0
70
+ - - "<="
65
71
  - !ruby/object:Gem::Version
66
- version: '3.5'
72
+ version: 3.5.0
67
73
  - !ruby/object:Gem::Dependency
68
74
  name: minitest
69
75
  requirement: !ruby/object:Gem::Requirement