Skip to content

Commit 36786a5

Browse files
committed
Fix test case
1 parent 365b487 commit 36786a5

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

spec/cmab_client_spec.rb

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# limitations under the License.
1717
#
1818
require 'spec_helper'
19+
require 'optimizely/logger'
1920
require 'optimizely/cmab/cmab_client'
2021

2122
describe Optimizely::DefaultCmabClient do
@@ -127,11 +128,7 @@
127128
end
128129

129130
it 'should return the variation id on first try with retry config but no retry needed' do
130-
client_with_retry = described_class.new(
131-
http_client: mock_http_client,
132-
logger: spy_logger,
133-
retry_config: retry_config
134-
)
131+
client_with_retry = described_class.new(mock_http_client, retry_config, spy_logger)
135132

136133
# Mock successful response
137134
mock_response = double('response', status_code: 200, json: {'predictions' => [{'variationId' => 'abc123'}]})
@@ -153,11 +150,7 @@
153150
end
154151

155152
it 'should return the variation id on third try with retry config' do
156-
client_with_retry = described_class.new(
157-
http_client: mock_http_client,
158-
logger: spy_logger,
159-
retry_config: retry_config
160-
)
153+
client_with_retry = described_class.new(mock_http_client, retry_config, spy_logger)
161154

162155
# Create failure and success responses
163156
failure_response = double('response', status_code: 500)
@@ -194,11 +187,7 @@
194187
end
195188

196189
it 'should exhausts all retry attempts' do
197-
client_with_retry = described_class.new(
198-
http_client: mock_http_client,
199-
logger: spy_logger,
200-
retry_config: retry_config
201-
)
190+
client_with_retry = described_class.new(mock_http_client, retry_config, spy_logger)
202191

203192
# Create failure response
204193
failure_response = double('response', status_code: 500)

0 commit comments

Comments
 (0)