Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rspamd-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module Rspamd
class << self
def setup(config)
@config = config.deep_symbolize_keys
@config = config&.deep_symbolize_keys
@clients = {}
end

Expand Down
7 changes: 7 additions & 0 deletions test/setup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ def test_caches_client_instances
assert_same client1, client2
end

def test_returns_stub_when_config_is_nil
Rspamd.setup(nil)

client = Rspamd.client_for(:outbound)
assert_instance_of Rspamd::ClientStub, client
end

def test_returns_stub_when_not_configured
client = Rspamd.client_for(:outbound)
assert_instance_of Rspamd::ClientStub, client
Expand Down
Loading