Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Calling stop in ldd mode no longer raises an exception #235

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions lib/ldclient-rb/ldclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def initialize(sdk_key, config = Config.default, wait_for_sec = 5)

if @config.use_ldd?
@config.logger.info { "[LDClient] Started LaunchDarkly Client in LDD mode" }
@data_source = NullUpdateProcessor.new
return # requestor and update processor are not used in this mode
end

Expand Down
17 changes: 17 additions & 0 deletions spec/ldclient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ module LaunchDarkly
end
end

context "client can be stopped" do
it "when in online mode" do
client = subject.new("sdk-key", Config.new)
client.close()
end

it "when in offline mode" do
client = subject.new("sdk-key", Config.new(offline: true))
client.close()
end

it "when in ldd mode" do
client = subject.new("sdk-key", Config.new(use_ldd: true))
client.close()
end
end

context "secure_mode_hash" do
it "will return the expected value for a known message and secret" do
ensure_close(subject.new("secret", test_config)) do |client|
Expand Down
Loading