codeclimate-poseidon 0.0.13 → 0.0.14

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: 0302cc6f1a4201b82c1f76a2254e5fad99c500e5
4
- data.tar.gz: 740e24b90c903253b87ea4a7af4baf65ea503b3e
3
+ metadata.gz: 89451780f4cbf5a82de300d746c4a438bf0bf677
4
+ data.tar.gz: 873cd07cf3f43dcab11603bb6158a33e105dde7e
5
5
  SHA512:
6
- metadata.gz: 4e4a6ad856eee78acf6a5ad2ebffb6ea0d4773373823444c959f70cf5c8d044144d8b03256a32691222ddcceeb03ff044c683ef8440e9aab861ba0a9cf943d7a
7
- data.tar.gz: 703b698973875c75c00f1b261f0cea3fbdaf601158010ea8858d4f28aaa000435722d05faab81be6cb73f7164a9996664e32a71b8ec2a74125294f5635739fcc
6
+ metadata.gz: a81fa0935d726c4ab4562b2563cabeaa67712b6fa5e12ce327914a3fdd92fb7b4180ed44cbb1f56a574866e7ddb8561b9165a2f7a53a0e3db333e08459230e23
7
+ data.tar.gz: e010e73bd02ea768b4ae1170ecd12bbdd3be649afb4fbcea4b1fd25d8977f071820d9557ff43081ee14cc65dd77cb3f57e747a8a02eb2e1fa4e4d5d0c9ece0c0
@@ -55,7 +55,7 @@ module Poseidon
55
55
  if broker_id
56
56
  @brokers[broker_id]
57
57
  else
58
- nil
58
+ raise ::Poseidon::Errors::UnknownTopicOrPartition
59
59
  end
60
60
  end
61
61
 
@@ -1,4 +1,4 @@
1
1
  module Poseidon
2
2
  # Unstable! API May Change!
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
@@ -23,6 +23,20 @@ RSpec.describe "consuming with multiple brokers", :type => :request do
23
23
  expect(brokers.size).to eq(3)
24
24
  end
25
25
 
26
+ it "raises a helpful error when there's no matching broker to be found" do
27
+ get_consumer = ->(partition) {
28
+ PartitionConsumer.consumer_for_partition(
29
+ "test_client",
30
+ ["localhost:9092"],
31
+ "test", partition,
32
+ :earliest_offset,
33
+ )
34
+ }
35
+
36
+ expect(get_consumer.(0)).to be_a PartitionConsumer
37
+ expect { get_consumer.(42) }.to raise_error(::Poseidon::Errors::UnknownTopicOrPartition)
38
+ end
39
+
26
40
  it "consumes from all partitions" do
27
41
  @p = Producer.new(["localhost:9092","localhost:9093","localhost:9094"], "test",
28
42
  :required_acks => 1)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-poseidon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Potter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2017-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.5.1
188
+ rubygems_version: 2.6.8
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Poseidon is a producer and consumer implementation for Kafka >= 0.8