Skip to content

Commit 69036c6

Browse files
committed
address imports in specs
1 parent fe3c9f7 commit 69036c6

File tree

9 files changed

+30
-19
lines changed

9 files changed

+30
-19
lines changed

lib/ldclient-rb/impl/data_system/fdv1.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
require 'ldclient-rb/impl/broadcaster'
33
require 'ldclient-rb/impl/data_source'
44
require 'ldclient-rb/impl/data_source/null_processor'
5+
require 'ldclient-rb/impl/data_source/polling'
6+
require 'ldclient-rb/impl/data_source/requestor'
7+
require 'ldclient-rb/impl/data_source/stream'
58
require 'ldclient-rb/impl/data_store'
69
require 'ldclient-rb/impl/data_system'
710
require 'ldclient-rb/impl/store_client_wrapper'
@@ -149,14 +152,12 @@ def target_availability
149152
return LaunchDarkly::Impl::DataSource::NullUpdateProcessor.new if @config.offline? || @config.use_ldd?
150153

151154
if @config.stream?
152-
require 'ldclient-rb/stream'
153-
return LaunchDarkly::StreamProcessor.new(@sdk_key, @config, @diagnostic_accumulator)
155+
return LaunchDarkly::Impl::DataSource::StreamProcessor.new(@sdk_key, @config, @diagnostic_accumulator)
154156
end
155157

156158
# Polling processor
157-
require 'ldclient-rb/polling'
158-
requestor = LaunchDarkly::Requestor.new(@sdk_key, @config)
159-
LaunchDarkly::PollingProcessor.new(@config, requestor)
159+
requestor = LaunchDarkly::Impl::DataSource::Requestor.new(@sdk_key, @config)
160+
LaunchDarkly::Impl::DataSource::PollingProcessor.new(@config, requestor)
160161
end
161162
end
162163
end

lib/ldclient-rb/ldclient.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
require "ldclient-rb/impl/big_segments"
22
require "ldclient-rb/impl/broadcaster"
3+
require "ldclient-rb/impl/context"
34
require "ldclient-rb/impl/data_source"
4-
require "ldclient-rb/impl/data_store"
55
require "ldclient-rb/impl/data_source/null_processor"
6+
require "ldclient-rb/impl/data_source/polling"
7+
require "ldclient-rb/impl/data_source/requestor"
8+
require "ldclient-rb/impl/data_source/stream"
9+
require "ldclient-rb/impl/data_store"
610
require "ldclient-rb/impl/diagnostic_events"
7-
require "ldclient-rb/impl/evaluator"
8-
require "ldclient-rb/events"
9-
require "ldclient-rb/in_memory_store"
1011
require "ldclient-rb/impl/evaluation_with_hook_result"
12+
require "ldclient-rb/impl/evaluator"
1113
require "ldclient-rb/impl/flag_tracker"
12-
require "ldclient-rb/impl/store_client_wrapper"
1314
require "ldclient-rb/impl/migrations/tracker"
15+
require "ldclient-rb/impl/store_client_wrapper"
16+
require "ldclient-rb/events"
17+
require "ldclient-rb/in_memory_store"
1418
require "concurrent"
1519
require "concurrent/atomics"
1620
require "digest/sha1"

spec/expiring_cache_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
require 'spec_helper'
12
require 'timecop'
2-
require "ldclient-rb/expiring_cache"
3+
require "ldclient-rb/impl/expiring_cache"
34

45
module LaunchDarkly
5-
describe ExpiringCache do
6-
subject { ExpiringCache }
6+
describe Impl::ExpiringCache do
7+
subject { Impl::ExpiringCache }
78

89
before(:each) do
910
Timecop.freeze(Time.now)

spec/impl/data_system/fdv1_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ module DataSystem
2424
end
2525

2626
it "creates streaming processor by default" do
27-
allow(LaunchDarkly::StreamProcessor).to receive(:new).and_call_original
27+
allow(LaunchDarkly::Impl::DataSource::StreamProcessor).to receive(:new).and_call_original
2828
subject.start
29-
expect(LaunchDarkly::StreamProcessor).to have_received(:new).with(sdk_key, config, nil)
29+
expect(LaunchDarkly::Impl::DataSource::StreamProcessor).to have_received(:new).with(sdk_key, config, nil)
3030
end
3131

3232
context "with polling mode" do
3333
let(:config) { LaunchDarkly::Config.new(stream: false) }
3434

3535
it "creates polling processor" do
36-
allow(LaunchDarkly::PollingProcessor).to receive(:new).and_call_original
36+
allow(LaunchDarkly::Impl::DataSource::PollingProcessor).to receive(:new).and_call_original
3737
subject.start
38-
expect(LaunchDarkly::PollingProcessor).to have_received(:new)
38+
expect(LaunchDarkly::Impl::DataSource::PollingProcessor).to have_received(:new)
3939
end
4040
end
4141

@@ -249,7 +249,7 @@ module DataSystem
249249
diagnostic_accumulator = double("DiagnosticAccumulator")
250250
subject.set_diagnostic_accumulator(diagnostic_accumulator)
251251

252-
expect(LaunchDarkly::StreamProcessor).to receive(:new).with(sdk_key, config, diagnostic_accumulator).and_call_original
252+
expect(LaunchDarkly::Impl::DataSource::StreamProcessor).to receive(:new).with(sdk_key, config, diagnostic_accumulator).and_call_original
253253
subject.start
254254
end
255255

@@ -261,7 +261,7 @@ module DataSystem
261261
subject.set_diagnostic_accumulator(diagnostic_accumulator)
262262

263263
# PollingProcessor doesn't accept diagnostic_accumulator
264-
expect(LaunchDarkly::PollingProcessor).to receive(:new).with(config, anything).and_call_original
264+
expect(LaunchDarkly::Impl::DataSource::PollingProcessor).to receive(:new).with(config, anything).and_call_original
265265
subject.start
266266
end
267267
end

spec/polling_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require "ldclient-rb/impl/data_source/polling"
12
require "ldclient-rb/impl/model/feature_flag"
23
require "ldclient-rb/impl/model/segment"
34
require 'ostruct'

spec/requestor_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require "http_util"
2+
require "ldclient-rb/impl/data_source/requestor"
23
require "model_builders"
34
require "spec_helper"
45

spec/simple_lru_cache_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require "ldclient-rb/impl/simple_lru_cache"
12
require "spec_helper"
23

34
module LaunchDarkly

spec/store_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require "ldclient-rb/impl/cache_store"
12
require "spec_helper"
23

34
module LaunchDarkly

spec/stream_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require "ldclient-rb/impl/data_source/stream"
12
require "ld-eventsource"
23
require "model_builders"
34
require "spec_helper"

0 commit comments

Comments
 (0)