beefcake 0.3.5 → 0.3.6

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.
@@ -14,7 +14,7 @@ module Beefcake
14
14
  end
15
15
 
16
16
  def append_info(fn, wire)
17
- self << ((fn << 3) | wire)
17
+ append_uint32((fn << 3) | wire)
18
18
  end
19
19
 
20
20
  def append_fixed32(n, tag=false)
@@ -1,3 +1,3 @@
1
1
  module Beefcake
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
data/test/message_test.rb CHANGED
@@ -88,6 +88,13 @@ class BoolMessage
88
88
  required :bool, :bool, 1
89
89
  end
90
90
 
91
+ class LargeFieldNumberMessage
92
+ include Beefcake::Message
93
+
94
+ required :field_1, :string, 1
95
+ required :field_2, :string, 100
96
+ end
97
+
91
98
  class MessageTest < Test::Unit::TestCase
92
99
  B = Beefcake::Buffer
93
100
 
@@ -220,6 +227,18 @@ class MessageTest < Test::Unit::TestCase
220
227
  assert_equal buf.to_s, msg.encode.to_s
221
228
  end
222
229
 
230
+ def test_encode_large_field_number
231
+ buf = Beefcake::Buffer.new
232
+ buf.append(:string, "abc", 1)
233
+ buf.append(:string, "123", 100)
234
+
235
+ msg = LargeFieldNumberMessage.new
236
+ msg.field_1 = "abc"
237
+ msg.field_2 = "123"
238
+
239
+ assert_equal buf.to_s, msg.encode.to_s
240
+ end
241
+
223
242
  ## Decoding
224
243
  def test_decode_numerics
225
244
  msg = NumericsMessage.new({
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beefcake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 5
10
- version: 0.3.5
9
+ - 6
10
+ version: 0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Blake Mizerany
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-01 00:00:00 -07:00
18
+ date: 2011-09-10 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21