cql-rb 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjQ0ZjFmMTgzZGI3ZDY1M2RjYTUzZGNmMWE5OTE1NWU5N2U5YWVmNg==
4
+ NzFiOTFkMzdmNTNhMzkzYzg0ZmM5ZGViZDI4NTk1OTk0NzM0NmY0Mg==
5
5
  data.tar.gz: !binary |-
6
- Mzk3OWFlMjg3ZTIzODk3OTNjZDcwNDM4OGEyNDI0MGM3MjE2ZTBiNQ==
6
+ MzRkNDQ2YjE0YmUyMjg0YTYyOWFhOTY4MDE2NGYwZDUwOTIxODEyOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjNiMTJlZDg3M2NmNGFlNTllNTZlNTRjZmJjOWEyODYxODFmMWFkOGY5NzBl
10
- ZTUxOGY1NjNjMzcxMjUwNDA2NjY0N2I0YTk0NWY0OWM5NzBkNzcyNzJkMDI5
11
- MzljMzNmZWZiYTRhMzMxYWQxMTk0MzVjMzliZjQ3NzVjMzlmY2M=
9
+ NGQwOWEyNzdiYTc0YThjNWNiNGMzODAwMGY3NDgwMWEwYzEzZGRhYmQ1N2Iz
10
+ MDljZTkyY2EwNzE3ZTY4ZWMyMGIyZWYyZTM2MWUyMDQyMDNiY2RmYTlhODli
11
+ ZTBjOTM1MmY3NGM5NDQxMDY1OTJkNWM0NDBlMDdjMjE0ZDMzY2Q=
12
12
  data.tar.gz: !binary |-
13
- MWIxYTk4ZDAwMDA3MDU4MDZmYmU1YmM0YWU5MTUwNmE1ODE5MzI5ZjBlMjA4
14
- YjI5OWIyN2IxMzRmZjYxMGY4ZmMwZTE5NTk2NDhjM2I2OTg3MWRlYThmOWEy
15
- ODQzN2VmODFhYjk0OTE1YWUxZWIwYjZjYzUxNTI5YTMxOTRjNTk=
13
+ ZjViNmJkNmQyYWIwZmQ4NGM4ZmJjMGFiYzc1NjFlZDRiYjBhZmU1ZGIxMzEw
14
+ MjQwOTAzODk1YmZjMTQyMDYyNDFhZTIyNDZiYmNjNDlhZDUwZDI4MWQ1MTIx
15
+ YTMwM2MwNjE0MDI4NDM5MTM5MjkyZjdkMDIyZDMxODk1NDhkYjc=
@@ -50,7 +50,7 @@ module Cql
50
50
  if @clock.now - @connection_started_at > @connection_timeout
51
51
  close(ConnectionTimeoutError.new("Could not connect to #{@host}:#{@port} within #{@connection_timeout}s"))
52
52
  end
53
- rescue Errno::EINVAL => e
53
+ rescue Errno::EINVAL, Errno::ECONNREFUSED => e
54
54
  if @addrinfos.empty?
55
55
  close(e)
56
56
  else
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Cql
4
- VERSION = '1.1.0'.freeze
4
+ VERSION = '1.1.1'.freeze
5
5
  end
@@ -137,6 +137,30 @@ module Cql
137
137
  end
138
138
  end
139
139
 
140
+ context 'when #connect_nonblock raises ECONNREFUSED' do
141
+ before do
142
+ socket_impl.stub(:sockaddr_in)
143
+ .with('PORT', 'IP2')
144
+ .and_return('SOCKADDR2')
145
+ socket_impl.stub(:new)
146
+ .with('FAMILY2', 'TYPE2', 0)
147
+ .and_return(socket)
148
+ socket.stub(:close)
149
+ end
150
+
151
+ it 'attempts to connect to the next address given by #getaddinfo' do
152
+ socket.should_receive(:connect_nonblock).with('SOCKADDR1').and_raise(Errno::ECONNREFUSED)
153
+ socket.should_receive(:connect_nonblock).with('SOCKADDR2')
154
+ handler.connect
155
+ end
156
+
157
+ it 'fails if there are no more addresses to try' do
158
+ socket.stub(:connect_nonblock).and_raise(Errno::ECONNREFUSED)
159
+ f = handler.connect
160
+ expect { f.value }.to raise_error(ConnectionError)
161
+ end
162
+ end
163
+
140
164
  context 'when #connect_nonblock raises SystemCallError' do
141
165
  before do
142
166
  socket.stub(:connect_nonblock).and_raise(SystemCallError.new('Bork!', 9999))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cql-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Hultberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-28 00:00:00.000000000 Z
11
+ date: 2013-11-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A pure Ruby CQL3 driver for Cassandra
14
14
  email: