Skip to content

Commit 90de2bf

Browse files
authored
Do not default endpoint with stub responses (#331)
1 parent 2d209ca commit 90de2bf

20 files changed

Lines changed: 45 additions & 69 deletions

gems/smithy-client/spec/smithy-client/log_formatter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Smithy
66
module Client
77
describe LogFormatter do
88
let(:client_class) { ClientHelper.sample_client.const_get(:Client) }
9-
let(:client) { client_class.new(stub_responses: true) }
9+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1010
let(:response) { client.operation }
1111

1212
def formatted(pattern, options = {})

gems/smithy-client/spec/smithy-client/plugins/checksum_required_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Plugins
99
let(:shapes) { ClientHelper.sample_shapes }
1010
let(:sample_client) { ClientHelper.sample_client(shapes: shapes) }
1111
let(:client_class) { sample_client.const_get(:Client) }
12-
let(:client) { client_class.new(stub_responses: true) }
12+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1313

1414
before do
1515
shapes['smithy.ruby.tests#Operation']['traits'] = { 'smithy.api#httpChecksumRequired' => {} }

gems/smithy-client/spec/smithy-client/plugins/default_params_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Plugins
88
describe ParamValidator do
99
let(:sample_client) { ClientHelper.sample_client }
1010
let(:client_class) { sample_client.const_get(:Client) }
11-
let(:client) { client_class.new(stub_responses: true) }
11+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1212

1313
it 'adds the handler' do
1414
expect(client.handlers).to include(DefaultParams::Handler)

gems/smithy-client/spec/smithy-client/plugins/http_api_key_auth_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Plugins
1515
client_class
1616
end
1717

18-
let(:client) { client_class.new(stub_responses: true) }
18+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1919

2020
before do
2121
shapes['smithy.ruby.tests#SampleClient']['traits']['smithy.api#httpApiKeyAuth'] = {}

gems/smithy-client/spec/smithy-client/plugins/http_basic_auth_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Plugins
1515
client_class
1616
end
1717

18-
let(:client) { client_class.new(stub_responses: true) }
18+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1919

2020
before do
2121
shapes['smithy.ruby.tests#SampleClient']['traits']['smithy.api#httpBasicAuth'] = {}

gems/smithy-client/spec/smithy-client/plugins/http_bearer_auth_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Plugins
1515
client_class
1616
end
1717

18-
let(:client) { client_class.new(stub_responses: true) }
18+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1919

2020
before do
2121
shapes['smithy.ruby.tests#SampleClient']['traits']['smithy.api#httpBearerAuth'] = {}

gems/smithy-client/spec/smithy-client/plugins/http_digest_auth_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Plugins
1515
client_class
1616
end
1717

18-
let(:client) { client_class.new(stub_responses: true) }
18+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1919

2020
before do
2121
shapes['smithy.ruby.tests#SampleClient']['traits']['smithy.api#httpDigestAuth'] = {}

gems/smithy-client/spec/smithy-client/plugins/idempotency_token_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Plugins
99
let(:shapes) { ClientHelper.sample_shapes }
1010
let(:sample_client) { ClientHelper.sample_client(shapes: shapes) }
1111
let(:client_class) { sample_client.const_get(:Client) }
12-
let(:client) { client_class.new(stub_responses: true) }
12+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
1313

1414
before do
1515
shapes['smithy.ruby.tests#Structure']['members']['string'] = {

gems/smithy-client/spec/smithy-client/plugins/logging_spec.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module Plugins
88
describe Logging do
99
let(:sample_client) { ClientHelper.sample_client }
1010
let(:client_class) { sample_client.const_get(:Client) }
11-
let(:client) { client_class.new(stub_responses: true) }
11+
let(:client_options) { { stub_responses: true, endpoint: 'https://example.com' } }
12+
let(:client) { client_class.new(client_options) }
1213

1314
let(:logger) { Logger.new(IO::NULL) }
1415
let(:log_level) { :info }
@@ -30,24 +31,24 @@ module Plugins
3031
end
3132

3233
it 'adds the handler when a logger is provided' do
33-
client = client_class.new(stub_responses: true, logger: logger)
34+
client = client_class.new(client_options.merge(logger: logger))
3435
expect(client.handlers).to include(Logging::Handler)
3536
end
3637

3738
it 'logs the output to the log level' do
38-
client = client_class.new(stub_responses: true, logger: logger)
39+
client = client_class.new(client_options.merge(logger: logger))
3940
expect(logger).to receive(client.config.log_level).with(instance_of(String))
4041
client.operation
4142
end
4243

4344
it 'logs the output using the log formatter' do
44-
client = client_class.new(stub_responses: true, logger: logger)
45+
client = client_class.new(client_options.merge(logger: logger))
4546
expect(client.config.log_formatter).to receive(:format).with(instance_of(Response))
4647
client.operation
4748
end
4849

4950
it 'sets start and end times in the context' do
50-
client = client_class.new(stub_responses: true, logger: logger, log_level: log_level)
51+
client = client_class.new(client_options.merge(logger: logger, log_level: log_level))
5152
response = client.operation
5253
expect(response.context[:logging_started_at]).to be_kind_of(Time)
5354
expect(response.context[:logging_completed_at]).to be_kind_of(Time)

gems/smithy-client/spec/smithy-client/plugins/pageable_response_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module Plugins
5555

5656
let(:sample_client) { ClientHelper.sample_client(shapes: shapes) }
5757
let(:client_class) { sample_client.const_get(:Client) }
58-
let(:client) { client_class.new(stub_responses: true) }
58+
let(:client) { client_class.new(stub_responses: true, endpoint: 'https://example.com') }
5959

6060
context 'pagination' do
6161
it 'can paginate with next_page and next_page?' do

0 commit comments

Comments
 (0)