Skip to content

Commit

Permalink
Merge pull request #160 from launchdarkly/eb/ch123138/fix-tests
Browse files Browse the repository at this point in the history
fix socket factory tests
  • Loading branch information
eli-darkly authored Sep 21, 2021
2 parents 9272882 + b57c6f4 commit f9f0060
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- run: gem install bundler -v 2.2.10
- run: bundle _2.2.10_ install
- run: mkdir ./rspec
- run: bundle _2.2.10_ exec rspec --format progress --format RspecJunitFormatter -o ./rspec/rspec.xml spec
- run: bundle _2.2.10_ exec rspec --format documentation --format RspecJunitFormatter -o ./rspec/rspec.xml spec
- store_test_results:
path: ./rspec
- store_artifacts:
Expand Down
6 changes: 4 additions & 2 deletions spec/event_sender_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ def with_sender_and_server
with_server do |server|
server.setup_ok_response("/bulk", "")

config = Config.new(events_uri: "http://events.com/bulk", socket_factory: SocketFactoryFromHash.new({"events.com" => server.port}), logger: $null_log)
config = Config.new(events_uri: "http://fake-event-server/bulk",
socket_factory: SocketFactoryFromHash.new({"fake-event-server" => server.port}),
logger: $null_log)
es = subject.new(sdk_key, config, nil, 0.1)

result = es.send_event_data(fake_data, "", false)

expect(result.success).to be true
req = server.await_request
expect(req.body).to eq fake_data
expect(req.host).to eq "events.com"
expect(req.host).to eq "fake-event-server"
end
end

Expand Down
8 changes: 4 additions & 4 deletions spec/ldclient_end_to_end_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ module LaunchDarkly

config = Config.new(
stream: false,
base_uri: "http://polling.com",
events_uri: "http://events.com",
base_uri: "http://fake-polling-server",
events_uri: "http://fake-events-server",
diagnostic_opt_out: true,
logger: NullLogger.new,
socket_factory: SocketFactoryFromHash.new({
"polling.com" => poll_server.port,
"events.com" => events_server.port
"fake-polling-server" => poll_server.port,
"fake-events-server" => events_server.port
})
)
with_client(config) do |client|
Expand Down

0 comments on commit f9f0060

Please sign in to comment.