Class: Karafka::Testing::RSpec::Proxy
- Inherits:
-
Object
- Object
- Karafka::Testing::RSpec::Proxy
- Defined in:
- lib/karafka/testing/rspec/proxy.rb
Overview
Proxy object for a nicer karafka.
API within RSpec None other should be used by the end users
Instance Method Summary collapse
- #consumer_for(*args) ⇒ Object
-
#consumer_messages ⇒ Array<Karafka::Messages::Message>
Array of messages that will be used to construct the final consumer messages batch.
-
#initialize(rspec_example) ⇒ Proxy
constructor
A new instance of Proxy.
- #produce(*args) ⇒ Object
-
#produced_messages ⇒ Array<Hash>
Messages produced via
Karafka#producer
.
Constructor Details
#initialize(rspec_example) ⇒ Proxy
Returns a new instance of Proxy.
10 11 12 |
# File 'lib/karafka/testing/rspec/proxy.rb', line 10 def initialize(rspec_example) @rspec_example = rspec_example end |
Instance Method Details
#consumer_for(*args) ⇒ Object
15 16 17 |
# File 'lib/karafka/testing/rspec/proxy.rb', line 15 def consumer_for(*args) @rspec_example._karafka_consumer_for(*args) end |
#consumer_messages ⇒ Array<Karafka::Messages::Message>
Returns array of messages that will be used to construct the final consumer messages batch.
31 32 33 |
# File 'lib/karafka/testing/rspec/proxy.rb', line 31 def @rspec_example. end |
#produce(*args) ⇒ Object
20 21 22 |
# File 'lib/karafka/testing/rspec/proxy.rb', line 20 def produce(*args) @rspec_example._karafka_produce(*args) end |
#produced_messages ⇒ Array<Hash>
Returns messages produced via Karafka#producer
.
25 26 27 |
# File 'lib/karafka/testing/rspec/proxy.rb', line 25 def @rspec_example. end |