karafka-testing 2.0.0.alpha2 → 2.0.0.alpha3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15ad20f0c6aec1676017e4b0ae1a22275418d4c7bf455d07d27cf0696e93b483
4
- data.tar.gz: 7316128b067662b376f001903eb993983752b9bd2fd2221ef900ba87891f047a
3
+ metadata.gz: 3769d261f8182c715897978e8209e8f4bc91f24f43bd2731144a50ae96d6de3a
4
+ data.tar.gz: fbed816843740c85f3c506f665fa3ceaee493d6e0455a59e28c46adda64ee183
5
5
  SHA512:
6
- metadata.gz: 1dd7c25d36e028d43566249a5cc46670bdaaada4c7610da2dbc7758d3f6b09f75f06520670ed1772cc1d1197a41b95096d5d857c53d78c39ab101ff534f4e946
7
- data.tar.gz: 3f318b4fa8690f7a44de1ac3774675044c1dfce57ace3f649a6656b03a8d97f296a25976438a208d7ff56fcc06a2d075aa142fcf94e37566e72920a61ecdede0
6
+ metadata.gz: 82006d2f8bc92018774fd99db5e9bdef1106eb4840e8f49d0ebade8cda05eede39ed6f523d3254f6154564b4a2bf0eb15421d1cbd3270f223d836e94b21c145d
7
+ data.tar.gz: 897ce9acfdff42145a5fceec9adeef5c4027707f2b2f3e894eb006a7a8a2424daa60a10e727bd18c2678d051d8ac8e2ad54d101b0b7b94e5a1dfcc7d44cb3873
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Karafka Test gem changelog
2
2
 
3
+ ## 2.0.0.alpha3 (2022-03-14)
4
+ - Provide support for referencing producer from consumer
5
+
3
6
  ## 2.0.0.alpha2 (2022-02-19)
4
7
  - Add `rubygems_mfa_required`
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-testing (2.0.0.alpha2)
4
+ karafka-testing (2.0.0.alpha3)
5
5
  karafka (~> 2.0.alpha2)
6
6
 
7
7
  GEM
@@ -56,7 +56,7 @@ GEM
56
56
  thor (>= 0.20)
57
57
  waterdrop (>= 2.2.0, < 3.0.0)
58
58
  zeitwerk (~> 2.3)
59
- mini_portile2 (2.7.1)
59
+ mini_portile2 (2.8.0)
60
60
  rake (13.0.6)
61
61
  rdkafka (0.11.1)
62
62
  ffi (~> 1.15)
@@ -73,11 +73,10 @@ GEM
73
73
  zeitwerk (2.5.4)
74
74
 
75
75
  PLATFORMS
76
- x86_64-darwin
77
76
  x86_64-linux
78
77
 
79
78
  DEPENDENCIES
80
79
  karafka-testing!
81
80
 
82
81
  BUNDLED WITH
83
- 2.3.6
82
+ 2.3.7
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Karafka Testing library
2
2
 
3
- **Note**: Documentation presented below works with Karafka `2.0.0.alpha1` and higher.
3
+ **Note**: Documentation presented below works with Karafka `2.0.0.alpha3` and higher.
4
4
 
5
5
  Please refer to [this](https://github.com/karafka/testing/tree/1.4) branch and its documentation for details about usage with Karafka `1.4`.
6
6
 
@@ -63,6 +63,24 @@ RSpec.describe InlineBatchConsumer do
63
63
  end
64
64
  ```
65
65
 
66
+ If your consumers use `producer` to dispatch messages, you can set up your expectations against it as well:
67
+
68
+ ```ruby
69
+ RSpec.describe InlineBatchConsumer do
70
+ subject(:consumer) { karafka.consumer_for(:inline_batch_data) }
71
+
72
+ before { karafka.publish({ 'number' => 1 }.to_json) }
73
+
74
+ it 'expects to dispatch async message to messages topic with value bigger by 1' do
75
+ expect(consumer.producer)
76
+ .to receive(:produce_async)
77
+ .with(topic: 'messages', payload: { number: 2 }.to_json)
78
+
79
+ consumer.consume
80
+ end
81
+ end
82
+ ```
83
+
66
84
  ## Note on contributions
67
85
 
68
86
  First, thank you for considering contributing to the Karafka ecosystem! It's people like you that make the open source community such a great community!
@@ -50,6 +50,7 @@ module Karafka
50
50
 
51
51
  consumer = described_class.new
52
52
  consumer.topic = selected_topic
53
+ consumer.producer = Karafka::App.producer
53
54
  consumer.client = Karafka::Testing::DummyClient.new
54
55
  consumer
55
56
  end
@@ -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.0.alpha2'
7
+ VERSION = '2.0.0.alpha3'
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.0.alpha2
4
+ version: 2.0.0.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -34,7 +34,7 @@ cert_chain:
34
34
  R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
35
35
  pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
36
36
  -----END CERTIFICATE-----
37
- date: 2022-02-19 00:00:00.000000000 Z
37
+ date: 2022-03-14 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: karafka
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: 1.3.1
102
102
  requirements: []
103
- rubygems_version: 3.3.3
103
+ rubygems_version: 3.3.4
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Library which provides helpers for easier Karafka consumers tests
metadata.gz.sig CHANGED
Binary file