Skip to content

Ensure that ssl option is read as expected #277

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lib/segment/analytics/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Transport
def initialize(options = {})
options[:host] ||= HOST
options[:port] ||= PORT
options[:ssl] ||= SSL
options.fetch(:ssl, SSL) == true
@headers = options[:headers] || HEADERS
@path = options[:path] || PATH
@retries = options[:retries] || RETRIES
Expand Down
4 changes: 3 additions & 1 deletion spec/segment/analytics/transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Analytics
allow(Net::HTTP).to receive(:new) { net_http }
end

it 'sets an initalized Net::HTTP read_timeout' do
it 'sets an initalized Net::HTTP use_ssl' do
expect(net_http).to receive(:use_ssl=)
described_class.new
end
Expand Down Expand Up @@ -75,6 +75,7 @@ class Analytics
backoff_policy: backoff_policy,
host: host,
port: port
ssl: false
}
end

Expand All @@ -95,6 +96,7 @@ class Analytics

it 'initializes a new Net::HTTP with passed in host and port' do
expect(Net::HTTP).to receive(:new).with(host, port)
expect(Net::HTTP).to receive(:use_ssl).with(false)
described_class.new(options)
end
end
Expand Down