WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 425c1c4

Browse files
committed
test: reading backup and bootstrap
1 parent 0690871 commit 425c1c4

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

spec/unleash/streaming_client_executor_spec.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
RSpec.describe Unleash::StreamingClientExecutor do
2+
subject(:streaming_executor) { Unleash::StreamingClientExecutor.new(executor_name, engine) }
3+
24
unless RUBY_ENGINE == 'jruby'
35
before do
46
Unleash.configure do |config|
@@ -39,15 +41,13 @@
3941
description: "Feature from backup",
4042
enabled: true,
4143
strategies: [{
42-
"name": "default"
44+
name: "default"
4345
}]
4446
}
4547
]
4648
}
4749
end
4850

49-
let(:streaming_executor) { described_class.new(executor_name, engine) }
50-
5151
before do
5252
backup_file = Unleash.configuration.backup_file
5353

@@ -56,7 +56,6 @@
5656
file.write(backup_toggles.to_json)
5757
end
5858

59-
# Simulate streaming connection failure
6059
WebMock.stub_request(:get, "http://streaming-test-url/client/streaming")
6160
.to_return(status: 500, body: "Internal Server Error", headers: {})
6261

@@ -89,12 +88,9 @@
8988
})
9089
end
9190

92-
let(:streaming_executor) { described_class.new(executor_name, engine) }
93-
9491
before do
9592
Unleash.configuration.bootstrap_config = bootstrap_config
9693

97-
# Streaming connection might succeed or fail, doesn't matter for bootstrap
9894
WebMock.stub_request(:get, "http://streaming-test-url/client/streaming")
9995
.to_return(status: 200, body: "", headers: {})
10096

@@ -135,8 +131,6 @@
135131
}
136132
end
137133

138-
let(:streaming_executor) { described_class.new(executor_name, engine) }
139-
140134
before do
141135
backup_file = Unleash.configuration.backup_file
142136

@@ -146,7 +140,6 @@
146140

147141
Unleash.configuration.bootstrap_config = invalid_bootstrap_config
148142

149-
# Streaming connection failure doesn't matter here
150143
WebMock.stub_request(:get, "http://streaming-test-url/client/streaming")
151144
.to_return(status: 500, body: "", headers: {})
152145

0 commit comments

Comments
 (0)