Module: Anyt::TestHelpers
- Defined in:
- lib/anyt/ext/minitest.rb
Overview
Common tests helpers
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
10 11 12 13 |
# File 'lib/anyt/ext/minitest.rb', line 10 def self.included(base) base.let(:client) { build_client(ignore: %w[ping welcome]) } base.after { @clients&.each { |client| client.close(allow_messages: true) } } end |
Instance Method Details
#build_client(*args) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/anyt/ext/minitest.rb', line 15 def build_client(*args) @clients ||= [] Anyt::Client.new(*args).tap do |client| @clients << client end end |
#remote_client ⇒ Object
30 31 32 |
# File 'lib/anyt/ext/minitest.rb', line 30 def remote_client @remote_client ||= RemoteControl::Client.connect(Anyt.config.remote_control_port) end |