karafka-testing 2.0.4 → 2.0.5

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
  SHA256:
3
- metadata.gz: 560aa633f1c2710d530871e4194d0cb631540c2844a97207b05bfe7297dba13a
4
- data.tar.gz: 6fb1dbb71bbb69f427356ee78b9ddc9fdeee83a9105564d7d9798ba6da3c6a70
3
+ metadata.gz: 513e1bb6f2a9ac5806fc7df36f788f4ba1b1f72286110e0584ad882d347453fe
4
+ data.tar.gz: a758a804787420eea61375763bcad90a6c2033426d46f8b07707fc5c22d9de72
5
5
  SHA512:
6
- metadata.gz: 0d0f3c2504f22eb9d3d36ba620b5e4f439c97d19b5607931a32a8bbbdf014a1cc772e0436d889e7536006c46b53239b248c44bfc230a0b69ae6d5c91b2e623ce
7
- data.tar.gz: 67f249bfd323f1c5f27bc97f78e33701a5cf6d42715c11e0b146857bf90ef7f00f307e4d1cb9e186947390c9fdff2bf98453fcc9483192a4a491a026d420e2f2
6
+ metadata.gz: e313af611899b8a3b47791d63694b24612bd97b27dde6262b929a7af315b64c0c2a1e0fd0b22fe25838d41b3c592c302b610e67031b44b27f08ee2daf78a4705
7
+ data.tar.gz: 18d88784906a4d19a33dab5ceca6236c1720d488c58b56e324464eb5730096c5f3bcfcfa3b8481fe4db974c10a2d294d3c91a50b9d7c030e28a0314531c1798c
checksums.yaml.gz.sig CHANGED
Binary file
@@ -61,7 +61,7 @@ jobs:
61
61
  strategy:
62
62
  fail-fast: false
63
63
  steps:
64
- - uses: actions/checkout@v2
64
+ - uses: actions/checkout@v3
65
65
  with:
66
66
  fetch-depth: 0
67
67
  - name: Run Coditsu
data/2.0-Upgrade.md CHANGED
@@ -7,7 +7,7 @@ Karafka-Testing 2.0 some breaking changes in the way consumer builder and messag
7
7
  Please upgrade your application to `Karafka 2.0` first.
8
8
 
9
9
  - Replace `#karafka_consumer_for` in your specs with `#karafka.consumer_for`
10
- - Replace `#publish_for_karafka` in your specs with `#karafka.publish`
10
+ - Replace `#publish_for_karafka` in your specs with `#karafka.produce`
11
11
 
12
12
  And that's all!
13
13
 
@@ -24,8 +24,8 @@ RSpec.describe CountersConsumer do
24
24
  let(:sum) { nr1_value + nr2_value }
25
25
 
26
26
  before do
27
- karafka.publish({ 'number' => nr1_value }.to_json)
28
- karafka.publish({ 'number' => nr2_value }.to_json, partition: 2)
27
+ karafka.produce({ 'number' => nr1_value }.to_json)
28
+ karafka.produce({ 'number' => nr2_value }.to_json, partition: 2)
29
29
  allow(Karafka.logger).to receive(:info)
30
30
  end
31
31
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Karafka Test gem changelog
2
2
 
3
+ ## 2.0.5 (2022-10-19)
4
+ - Fix for: Test event production without defining a subject (#102)
5
+
3
6
  ## 2.0.4 (2022-10-14)
4
7
  - Align changes with Karafka `2.0.13` changes.
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-testing (2.0.4)
4
+ karafka-testing (2.0.5)
5
5
  karafka (>= 2.0, < 3.0.0)
6
6
 
7
7
  GEM
@@ -9,7 +9,7 @@ GEM
9
9
  specs:
10
10
  concurrent-ruby (1.1.10)
11
11
  ffi (1.15.5)
12
- karafka (2.0.13)
12
+ karafka (2.0.14)
13
13
  karafka-core (>= 2.0.2, < 3.0.0)
14
14
  rdkafka (>= 0.12)
15
15
  thor (>= 0.20)
@@ -31,10 +31,11 @@ GEM
31
31
  zeitwerk (2.6.1)
32
32
 
33
33
  PLATFORMS
34
+ arm64-darwin
34
35
  x86_64-linux
35
36
 
36
37
  DEPENDENCIES
37
38
  karafka-testing!
38
39
 
39
40
  BUNDLED WITH
40
- 2.3.22
41
+ 2.3.24
@@ -85,6 +85,10 @@ module Karafka
85
85
  # karafka.produce({ 'hello' => 'world' }.to_json, 'partition' => 6)
86
86
  # end
87
87
  def _karafka_add_message_to_consumer_if_needed(message)
88
+ # We're interested in adding message to subject only when it is a consumer
89
+ # Users may want to test other things (models producing messages for example) and in
90
+ # their case subject will not be a consumer
91
+ return unless subject.is_a?(Karafka::BaseConsumer)
88
92
  # We target to the consumer only messages that were produced to it, since specs may also
89
93
  # produce other messages targeting other topics
90
94
  return unless message[:topic] == subject.topic.name
@@ -4,6 +4,6 @@
4
4
  module Karafka
5
5
  module Testing
6
6
  # Current version of gem. It should match Karafka framework version
7
- VERSION = '2.0.4'
7
+ VERSION = '2.0.5'
8
8
  end
9
9
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2022-10-14 00:00:00.000000000 Z
38
+ date: 2022-10-19 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka
metadata.gz.sig CHANGED
Binary file