codeclimate-poseidon 0.0.12 → 0.0.13

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: aa02e321bdedaf1f2ab107fa19baa839f8b8975e
4
- data.tar.gz: 6be2d71921b325c65013edaa05f4be605f67bf61
3
+ metadata.gz: 0302cc6f1a4201b82c1f76a2254e5fad99c500e5
4
+ data.tar.gz: 740e24b90c903253b87ea4a7af4baf65ea503b3e
5
5
  SHA512:
6
- metadata.gz: 343ba22d428d48fb50daecf1ba728be6add2918a0ae7c5fc6df477efb61de63e8f8c2d23d67d95a9aec7e1e65ee0646871ad532f274b74943d8a3c0f032b9e9c
7
- data.tar.gz: e75c0e4afff8b28bd50a0ed331727c7f3d432907257616f9cab8ec95b802c5520dbeb80c3159ea6a99b4be54671a71944d930242e39442d7a0f50193e37fb6b4
6
+ metadata.gz: 4e4a6ad856eee78acf6a5ad2ebffb6ea0d4773373823444c959f70cf5c8d044144d8b03256a32691222ddcceeb03ff044c683ef8440e9aab861ba0a9cf943d7a
7
+ data.tar.gz: 703b698973875c75c00f1b261f0cea3fbdaf601158010ea8858d4f28aaa000435722d05faab81be6cb73f7164a9996664e32a71b8ec2a74125294f5635739fcc
@@ -49,6 +49,8 @@ module Poseidon
49
49
 
50
50
  # Return lead broker for topic and partition
51
51
  def lead_broker_for_partition(topic_name, partition)
52
+ raise ::Poseidon::Errors::UnknownTopicOrPartition unless @topic_metadata[topic_name]
53
+
52
54
  broker_id = @topic_metadata[topic_name].partition_leader(partition)
53
55
  if broker_id
54
56
  @brokers[broker_id]
@@ -1,4 +1,4 @@
1
1
  module Poseidon
2
2
  # Unstable! API May Change!
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.13"
4
4
  end
@@ -42,5 +42,11 @@ RSpec.describe ClusterMetadata do
42
42
  expect(@cm.lead_broker_for_partition("test",1).id).to eq(1)
43
43
  expect(@cm.lead_broker_for_partition("test",2).id).to eq(2)
44
44
  end
45
+
46
+ it "raises an UnknownErrorOrPartition when the topic does not exist" do
47
+ expect {
48
+ @cm.lead_broker_for_partition("nonsense",1)
49
+ }.to raise_error(::Poseidon::Errors::UnknownTopicOrPartition)
50
+ end
45
51
  end
46
52
  end
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.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Potter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-04 00:00:00.000000000 Z
11
+ date: 2017-01-16 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.4.5
188
+ rubygems_version: 2.5.1
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Poseidon is a producer and consumer implementation for Kafka >= 0.8