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 +4 -4
- data/lib/protip/wrapper.rb +1 -1
- data/test/unit/protip/wrapper_test.rb +28 -0
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbafb63f09c98b4e08843c2d8766bed6fec8aebe
|
4
|
+
data.tar.gz: bef3aa7d77fca8a813e3fba56194303ae626b7b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35b8f01c76f8ddb6cbd7342a6043ea1d590b9753fe74067da416602593289ceeecb869fbebd5d31df1b50b7c97eb5f91941b99e2b643da4d40fbfdc799d59ec3
|
7
|
+
data.tar.gz: 1d7464462a49f72d1d77745e808f60ddae60b126c1ab75f302f1ffb0fe4dba7a30969353c6b6c9d9458d80af601c19a3e4ee3e797a1a0e6833b6564295fa348b
|
data/lib/protip/wrapper.rb
CHANGED
@@ -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.
|
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-
|
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:
|
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:
|
72
|
+
version: 3.5.0
|
67
73
|
- !ruby/object:Gem::Dependency
|
68
74
|
name: minitest
|
69
75
|
requirement: !ruby/object:Gem::Requirement
|