|
1 | 1 | RSpec.describe Unleash::StreamingClientExecutor do |
| 2 | + subject(:streaming_executor) { Unleash::StreamingClientExecutor.new(executor_name, engine) } |
| 3 | + |
2 | 4 | unless RUBY_ENGINE == 'jruby' |
3 | 5 | before do |
4 | 6 | Unleash.configure do |config| |
|
39 | 41 | description: "Feature from backup", |
40 | 42 | enabled: true, |
41 | 43 | strategies: [{ |
42 | | - "name": "default" |
| 44 | + name: "default" |
43 | 45 | }] |
44 | 46 | } |
45 | 47 | ] |
46 | 48 | } |
47 | 49 | end |
48 | 50 |
|
49 | | - let(:streaming_executor) { described_class.new(executor_name, engine) } |
50 | | - |
51 | 51 | before do |
52 | 52 | backup_file = Unleash.configuration.backup_file |
53 | 53 |
|
|
56 | 56 | file.write(backup_toggles.to_json) |
57 | 57 | end |
58 | 58 |
|
59 | | - # Simulate streaming connection failure |
60 | 59 | WebMock.stub_request(:get, "http://streaming-test-url/client/streaming") |
61 | 60 | .to_return(status: 500, body: "Internal Server Error", headers: {}) |
62 | 61 |
|
|
89 | 88 | }) |
90 | 89 | end |
91 | 90 |
|
92 | | - let(:streaming_executor) { described_class.new(executor_name, engine) } |
93 | | - |
94 | 91 | before do |
95 | 92 | Unleash.configuration.bootstrap_config = bootstrap_config |
96 | 93 |
|
97 | | - # Streaming connection might succeed or fail, doesn't matter for bootstrap |
98 | 94 | WebMock.stub_request(:get, "http://streaming-test-url/client/streaming") |
99 | 95 | .to_return(status: 200, body: "", headers: {}) |
100 | 96 |
|
|
135 | 131 | } |
136 | 132 | end |
137 | 133 |
|
138 | | - let(:streaming_executor) { described_class.new(executor_name, engine) } |
139 | | - |
140 | 134 | before do |
141 | 135 | backup_file = Unleash.configuration.backup_file |
142 | 136 |
|
|
146 | 140 |
|
147 | 141 | Unleash.configuration.bootstrap_config = invalid_bootstrap_config |
148 | 142 |
|
149 | | - # Streaming connection failure doesn't matter here |
150 | 143 | WebMock.stub_request(:get, "http://streaming-test-url/client/streaming") |
151 | 144 | .to_return(status: 500, body: "", headers: {}) |
152 | 145 |
|
|
0 commit comments