protip 0.12.0 → 0.12.1

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: c275589cac97c73b2b4405fca77fe0c0c93a94af
4
- data.tar.gz: 659c9ec2117a91a5d6e1e0fdff7c0b5ef91e9586
3
+ metadata.gz: 455d3b14051cc93b7ea272ca79f4bbdd039c52ae
4
+ data.tar.gz: 59972d336a1e6cb1cff3c0b14f7da0434b3b7ad1
5
5
  SHA512:
6
- metadata.gz: 48c71ba8914797e87a10363fda5c73bc1a02cc5f7a9889f86658251314489808ce733982c3104639f821b24a068708f6fb3df446c855e66e886e9fbd59a5ccb8
7
- data.tar.gz: b567785146d15ef596bf19dffebc73f340120112821d7aca826c8f0431162e86a99bdf8429837ac6c772e9a29b0fc21fd9aa4c7d6ab866a24a9df56b3ba05f6a
6
+ metadata.gz: 4863cfd3abd63d5efd19c54a7b8b734ae25a662cc3e6c5d5f0d8b87ae2fe648f7d3325e79a436fd49ca84e1102bbf4b26f90e45bf38e754ead646fd4968c4de6
7
+ data.tar.gz: 78b333c4dfac5fa1f3114fe389f187e5ed8a6ff103fb01003fb2c512ca66358d13d4e8305c29634a1a9637b77919ef3050afc8637f792c6e83c3c7b728c2eace
@@ -163,13 +163,22 @@ module Protip::WrapperTest # namespace for internal constants
163
163
  converter.stubs(:convertible?).with(inner_message_class).returns(true)
164
164
  end
165
165
 
166
- it 'converts Ruby values to protobuf messages' do
167
- converter.stubs(:convertible?).with(inner_message_class).returns(true)
166
+ it 'converts scalar Ruby values to protobuf messages' do
168
167
  converter.expects(:to_message).once.with(45, inner_message_class).returns(inner_message_class.new(value: 43))
169
168
  wrapper.assign_attributes inner: 45
170
169
  assert_equal inner_message_class.new(value: 43), wrapped_message.inner
171
170
  end
172
171
 
172
+ it 'converts repeated Ruby values to protobuf messages' do
173
+ invocation = 0
174
+ converter.expects(:to_message).twice.with do |value|
175
+ invocation += 1
176
+ value == invocation
177
+ end.returns(inner_message_class.new(value: 43), inner_message_class.new(value: 44))
178
+ wrapper.assign_attributes inners: [1, 2]
179
+ assert_equal [inner_message_class.new(value: 43), inner_message_class.new(value: 44)], wrapped_message.inners
180
+ end
181
+
173
182
  it 'allows messages to be assigned directly' do
174
183
  message = inner_message_class.new
175
184
  wrapper.assign_attributes inner: message
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.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AngelList
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-20 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -56,14 +56,14 @@ dependencies:
56
56
  requirements:
57
57
  - - '='
58
58
  - !ruby/object:Gem::Version
59
- version: 3.0.0.alpha.3
59
+ version: 3.0.0.alpha.4
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - '='
65
65
  - !ruby/object:Gem::Version
66
- version: 3.0.0.alpha.3
66
+ version: 3.0.0.alpha.4
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: minitest
69
69
  requirement: !ruby/object:Gem::Requirement