rexpro 1.0.1 → 1.0.2

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: b24a3354cd2b1dde7ee5466c2138bd096a47c35b
4
- data.tar.gz: 9a8256eb43e1720a3906845c7bcff0c09b031735
3
+ metadata.gz: c285c8ba0eff69cc073538af4ec13e778e4bd446
4
+ data.tar.gz: 6222bc5d0537fc9b5a7930b6cb2e5675fe99838b
5
5
  SHA512:
6
- metadata.gz: ed52b09119f23aa8d8bf84b45576ca27227bc3d8c10baf1b369bfa445d9e117b069673682a3c9831755b167f3ff8d89f398e8f574767f63f8f30eb9ffb6c9ebd
7
- data.tar.gz: 8970a0d82370c25d04ae307435fc0643baf714103dc378a1fcf8e997c059731c9bdaac12ee8de3c2474e41db5f02b9b23d6c3951305955a25a32ca458c5d9c5a
6
+ metadata.gz: 44e8e198fc74b2178c377e3261a950a06dec30712d39f3a1e51d118e17b2be597b7b730269c2c7c5ddd225bc3c348f53d6a491eaf83c2b83eab22c95a74dc23f
7
+ data.tar.gz: 794291c0201aaf38028a08147ae5c114b80dfe0350a6d21bada272ac4ea16783e4923895d2ec198ab5c5f5854fef9cbb2ade41f85d63a954a6bd8bff56bc9ca0
@@ -140,8 +140,7 @@ module Rexpro
140
140
  header = [
141
141
  PROTOCOL_VERSION, serializer_type, 0, self.class.type, body.size
142
142
  ].pack('CCNCN')
143
- io.write(header)
144
- io.write(body)
143
+ io.write(header + body)
145
144
  end
146
145
  end
147
146
 
@@ -1,3 +1,3 @@
1
1
  module Rexpro
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -50,8 +50,8 @@ describe Rexpro::Message::SessionRequest do
50
50
  it 'correctly writes to the io object' do
51
51
  subject.session_uuid = 'abcdefghijklmnop'
52
52
  subject.write_to(io)
53
- io.string.must_equal "\x01\x00\x00\x00\x00\x00\x01\x00\x00\x00&\x95\xB0abcdefghijklmnop" +
54
- "\xB01234567812345678\x80\xA0\xA0"
53
+ io.string.must_equal "\x01\x00\x00\x00\x00\x00\x01\x00\x00\x00&\x95\xB0" +
54
+ "abcdefghijklmnop\xB01234567812345678\x80\xA0\xA0"
55
55
  end
56
56
 
57
57
  it 'is symmetrical with .read_from' do
@@ -61,5 +61,23 @@ describe Rexpro::Message::SessionRequest do
61
61
  msg.must_be_instance_of Rexpro::Message::SessionRequest
62
62
  msg.request_uuid.must_equal subject.request_uuid
63
63
  end
64
+
65
+ describe 'write count' do
66
+ class WriteCounter
67
+ attr_accessor :write_count
68
+
69
+ def write(*)
70
+ @write_count ||= 0
71
+ @write_count += 1
72
+ end
73
+ end
74
+
75
+ let(:io) { WriteCounter.new }
76
+
77
+ it 'makes only one .write call' do
78
+ subject.write_to(io)
79
+ io.write_count.must_equal 1
80
+ end
81
+ end
64
82
  end
65
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexpro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lann Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-17 00:00:00.000000000 Z
11
+ date: 2013-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack