cql-rb 1.0.0.pre5 → 1.0.0.pre6
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.
- data/README.md +61 -46
- data/lib/cql.rb +1 -0
- data/lib/cql/byte_buffer.rb +138 -0
- data/lib/cql/future.rb +3 -0
- data/lib/cql/io/node_connection.rb +29 -26
- data/lib/cql/protocol.rb +1 -1
- data/lib/cql/protocol/decoding.rb +41 -33
- data/lib/cql/protocol/encoding.rb +4 -15
- data/lib/cql/protocol/request_frame.rb +3 -3
- data/lib/cql/protocol/response_frame.rb +174 -81
- data/lib/cql/version.rb +1 -1
- data/spec/cql/byte_buffer_spec.rb +299 -0
- data/spec/cql/io/io_reactor_spec.rb +13 -16
- data/spec/cql/protocol/decoding_spec.rb +128 -91
- data/spec/cql/protocol/encoding_spec.rb +8 -57
- data/spec/cql/protocol/request_frame_spec.rb +10 -5
- data/spec/cql/protocol/response_frame_spec.rb +31 -15
- data/spec/integration/client_spec.rb +4 -0
- data/spec/integration/protocol_spec.rb +1 -1
- data/spec/integration/regression_spec.rb +41 -14
- data/spec/spec_helper.rb +13 -6
- data/spec/support/bytes_helper.rb +1 -1
- data/spec/support/fake_server.rb +10 -2
- metadata +5 -2
data/spec/spec_helper.rb
CHANGED
@@ -4,15 +4,22 @@ require 'bundler/setup'
|
|
4
4
|
require 'simplecov'; SimpleCov.start
|
5
5
|
require 'cql'
|
6
6
|
|
7
|
-
ENV['CASSANDRA_HOST'] ||= '
|
7
|
+
ENV['CASSANDRA_HOST'] ||= '127.0.0.1'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
require 'bundler/setup'
|
10
|
+
|
11
|
+
unless ENV['COVERAGE'] == 'no'
|
12
|
+
require 'simplecov'
|
13
|
+
SimpleCov.start do
|
14
|
+
add_group 'Source', 'lib'
|
15
|
+
add_group 'Unit tests', 'spec/cql'
|
16
|
+
add_group 'Integration tests', 'spec/integration'
|
17
|
+
add_group 'Test support', 'spec/support'
|
18
|
+
end
|
14
19
|
end
|
15
20
|
|
21
|
+
require 'cql'
|
22
|
+
|
16
23
|
require 'support/bytes_helper'
|
17
24
|
require 'support/await_helper'
|
18
25
|
require 'support/fake_server'
|
data/spec/support/fake_server.rb
CHANGED
@@ -48,11 +48,19 @@ class FakeServer
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def await_connects!(n=1)
|
51
|
-
|
51
|
+
started_at = Time.now
|
52
|
+
until @connects >= n
|
53
|
+
sleep(0.01)
|
54
|
+
raise 'Waited longer than 5s!' if (Time.now - started_at) > 5
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
def await_disconnects!(n=1)
|
55
|
-
|
59
|
+
started_at = Time.now
|
60
|
+
until @disconnects >= n
|
61
|
+
sleep(0.01)
|
62
|
+
raise 'Waited longer than 5s!' if (Time.now - started_at) > 5
|
63
|
+
end
|
56
64
|
end
|
57
65
|
|
58
66
|
def received_bytes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cql-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre6
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A pure Ruby CQL3 driver for Cassandra
|
15
15
|
email:
|
@@ -18,6 +18,7 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
+
- lib/cql/byte_buffer.rb
|
21
22
|
- lib/cql/client.rb
|
22
23
|
- lib/cql/future.rb
|
23
24
|
- lib/cql/io/io_reactor.rb
|
@@ -33,6 +34,7 @@ files:
|
|
33
34
|
- lib/cql.rb
|
34
35
|
- bin/cqlexec
|
35
36
|
- README.md
|
37
|
+
- spec/cql/byte_buffer_spec.rb
|
36
38
|
- spec/cql/client_spec.rb
|
37
39
|
- spec/cql/future_spec.rb
|
38
40
|
- spec/cql/io/io_reactor_spec.rb
|
@@ -75,6 +77,7 @@ signing_key:
|
|
75
77
|
specification_version: 3
|
76
78
|
summary: Cassandra CQL3 driver
|
77
79
|
test_files:
|
80
|
+
- spec/cql/byte_buffer_spec.rb
|
78
81
|
- spec/cql/client_spec.rb
|
79
82
|
- spec/cql/future_spec.rb
|
80
83
|
- spec/cql/io/io_reactor_spec.rb
|