Skip to content

Commit 6d92a63

Browse files
committed
Un-expose client provider, comment out corresponding tests
Signed-off-by: William Kim <[email protected]>
1 parent 746f69c commit 6d92a63

File tree

2 files changed

+36
-31
lines changed

2 files changed

+36
-31
lines changed

lib/open_feature/sdk/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Client
88
RESULT_TYPE = %i[boolean string number object].freeze
99
SUFFIXES = %i[value details].freeze
1010

11-
attr_reader :metadata, :provider
11+
attr_reader :metadata
1212

1313
attr_accessor :hooks
1414

spec/open_feature/sdk/api_spec.rb

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -71,43 +71,48 @@
7171
pending
7272
end
7373

74-
context "when domain is given" do
75-
it "can generate a client both with and without that domain" do
76-
provider = OpenFeature::SDK::Provider::InMemoryProvider.new
74+
# TODO: These tests should be re-enabled when the client's provider is exposed via the metadata
75+
# See this PR for context: https://github.com/open-feature/ruby-sdk/pull/109
7776

78-
api.configure do |config|
79-
config.set_provider(provider, domain: "testing1")
80-
end
77+
# context "when domain is given" do
78+
# it "can generate a client both with and without that domain" do
79+
# provider = OpenFeature::SDK::Provider::InMemoryProvider.new
8180

82-
client = api.build_client(domain: "testing1")
83-
no_domain_client = api.build_client
81+
# api.configure do |config|
82+
# config.set_provider(provider, domain: "testing1")
83+
# end
8484

85-
expect(client.provider).to be(provider)
86-
expect(no_domain_client.provider).to be_an_instance_of(OpenFeature::SDK::Provider::NoOpProvider)
87-
end
88-
end
85+
# client = api.build_client(domain: "testing1")
86+
# no_domain_client = api.build_client
8987

90-
context "when domain is not provided" do
91-
it "can generate a client without a domain properly" do
92-
provider = OpenFeature::SDK::Provider::InMemoryProvider.new
88+
# expect(client.provider).to be(provider)
89+
# expect(no_domain_client.provider).to be_an_instance_of(OpenFeature::SDK::Provider::NoOpProvider)
90+
# end
91+
# end
9392

94-
api.configure do |config|
95-
config.set_provider(provider)
96-
end
93+
# context "when domain is not provided" do
94+
# it "can generate a client without a domain properly" do
95+
# provider = OpenFeature::SDK::Provider::InMemoryProvider.new
9796

98-
no_domain_client = api.build_client
97+
# api.configure do |config|
98+
# config.set_provider(provider)
99+
# end
99100

100-
expect(no_domain_client.provider).to be(provider)
101-
end
101+
# no_domain_client = api.build_client
102102

103-
it "can generate a client with a domain properly" do
104-
api.configure do |config|
105-
config.set_provider(OpenFeature::SDK::Provider::InMemoryProvider.new)
106-
end
103+
# expect(no_domain_client.provider).to be(provider)
104+
# end
107105

108-
domain_client = api.build_client(domain: "testing2")
109-
# This domain was never given a provider, so it should default to the NoOpProvider
110-
expect(domain_client.provider).to be_an_instance_of(OpenFeature::SDK::Provider::NoOpProvider)
111-
end
112-
end
106+
# it "can generate a client with a domain properly" do
107+
# api.configure do |config|
108+
# config.set_provider(OpenFeature::SDK::Provider::InMemoryProvider.new)
109+
# end
110+
111+
# domain_client = api.build_client(domain: "testing2")
112+
# # This domain was never given a provider, so it should default to the NoOpProvider
113+
# expect(domain_client.provider).to be_an_instance_of(OpenFeature::SDK::Provider::NoOpProvider)
114+
# end
115+
# end
116+
117+
# End Client provider metadata tests
113118
end

0 commit comments

Comments
 (0)