beefcake 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/beefcake/buffer/encode.rb +1 -1
- data/lib/beefcake/version.rb +1 -1
- data/test/message_test.rb +19 -0
- metadata +4 -4
data/lib/beefcake/version.rb
CHANGED
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:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
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-
|
18
|
+
date: 2011-09-10 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|