-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement Requirement 1.1.2 (#78)
Signed-off-by: Max VelDink <[email protected]>
- Loading branch information
1 parent
2d89570
commit 8cea7d0
Showing
7 changed files
with
113 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
RSpec.describe OpenFeature::SDK::Configuration do | ||
subject(:configuration) { described_class.new } | ||
|
||
describe "#provider=" do | ||
context "when provider has an init method" do | ||
let(:provider) { TestProvider.new } | ||
|
||
it "inits and sets the provider" do | ||
expect(provider).to receive(:init) | ||
|
||
configuration.provider = provider | ||
|
||
expect(configuration.provider).to be(provider) | ||
end | ||
end | ||
|
||
context "when provider does not have an init method" do | ||
it "sets the provider" do | ||
provider = OpenFeature::SDK::Provider::NoOpProvider.new | ||
|
||
configuration.provider = provider | ||
|
||
expect(configuration.provider).to be(provider) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class TestProvider | ||
def init | ||
end | ||
|
||
def shutdown | ||
end | ||
end |