rspeed 0.3.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/README.md +10 -7
- data/lib/generators/rspeed/install_generator.rb +1 -1
- data/lib/rspeed.rb +9 -7
- data/lib/rspeed/database.rb +11 -0
- data/lib/rspeed/differ.rb +55 -0
- data/lib/rspeed/env.rb +39 -0
- data/lib/rspeed/extension.rb +3 -2
- data/lib/rspeed/logger.rb +13 -0
- data/lib/rspeed/observer.rb +21 -6
- data/lib/rspeed/redis.rb +72 -0
- data/lib/rspeed/runner.rb +4 -15
- data/lib/rspeed/splitter.rb +24 -97
- data/lib/rspeed/variable.rb +30 -0
- data/lib/rspeed/version.rb +1 -1
- data/spec/common_helper.rb +10 -0
- data/spec/fixtures/1_spec.rb +9 -0
- data/spec/fixtures/2_spec.rb +5 -0
- data/spec/fixtures/empty.rb +4 -0
- data/spec/models/rspeed/database/result_spec.rb +17 -0
- data/spec/models/rspeed/differ/actual_data_spec.rb +20 -0
- data/spec/models/rspeed/differ/actual_files_spec.rb +20 -0
- data/spec/models/rspeed/differ/added_data_spec.rb +19 -0
- data/spec/models/rspeed/differ/diff_spec.rb +51 -0
- data/spec/models/rspeed/differ/removed_data_spec.rb +20 -0
- data/spec/models/rspeed/differ/removed_time_spec.rb +14 -0
- data/spec/models/rspeed/env/app_spec.rb +17 -0
- data/spec/models/rspeed/env/db_spec.rb +17 -0
- data/spec/models/rspeed/env/host_spec.rb +17 -0
- data/spec/models/rspeed/env/pipe_spec.rb +19 -0
- data/spec/models/rspeed/env/pipes_spec.rb +19 -0
- data/spec/models/rspeed/env/port_spec.rb +17 -0
- data/spec/models/rspeed/env/rspeed_spec.rb +43 -0
- data/spec/models/rspeed/env/spec_path_spec.rb +19 -0
- data/spec/models/rspeed/observer/after_spec.rb +5 -5
- data/spec/models/rspeed/observer/after_suite_spec.rb +35 -0
- data/spec/models/rspeed/observer/before_spec.rb +0 -2
- data/spec/models/rspeed/observer/before_suite_spec.rb +18 -6
- data/spec/models/rspeed/redis/clean_spec.rb +20 -0
- data/spec/models/rspeed/redis/client_spec.rb +7 -0
- data/spec/models/rspeed/redis/destroy_spec.rb +21 -0
- data/spec/models/rspeed/redis/get_spec.rb +11 -0
- data/spec/models/rspeed/redis/keys_spec.rb +13 -0
- data/spec/models/rspeed/redis/list_spec.rb +19 -0
- data/spec/models/rspeed/redis/profiles_content_spec.rb +19 -0
- data/spec/models/rspeed/redis/result_spec.rb +13 -0
- data/spec/models/rspeed/redis/set_spec.rb +11 -0
- data/spec/models/rspeed/redis/specs_finished_spec.rb +19 -0
- data/spec/models/rspeed/redis/specs_initiated_spec.rb +13 -0
- data/spec/models/rspeed/runner/run_spec.rb +73 -0
- data/spec/models/rspeed/splitter/append_spec.rb +8 -28
- data/spec/models/rspeed/splitter/consolidate_spec.rb +23 -0
- data/spec/models/rspeed/splitter/first_pipe_spec.rb +4 -8
- data/spec/models/rspeed/splitter/need_warm_question_spec.rb +35 -0
- data/spec/models/rspeed/splitter/pipe_files_spec.rb +21 -0
- data/spec/models/rspeed/splitter/split_spec.rb +32 -34
- data/spec/models/rspeed/variable/append_app_name_spec.rb +33 -0
- data/spec/models/rspeed/variable/key_spec.rb +15 -0
- data/spec/models/rspeed/variable/pipe_spec.rb +23 -0
- data/spec/models/rspeed/variable/pipes_pattern_spec.rb +5 -0
- data/spec/models/rspeed/variable/profile_pattern_spec.rb +5 -0
- data/spec/models/rspeed/variable/profile_spec.rb +23 -0
- data/spec/models/rspeed/variable/result_spec.rb +19 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/support/common.rb +13 -0
- data/spec/support/coverage.rb +14 -0
- data/spec/support/env_mock.rb +3 -0
- data/spec/support/fakeredis.rb +3 -0
- metadata +160 -26
- data/spec/models/rspeed/splitter/destroy_spec.rb +0 -33
- data/spec/models/rspeed/splitter/diff_spec.rb +0 -29
- data/spec/models/rspeed/splitter/get_spec.rb +0 -76
- data/spec/models/rspeed/splitter/keys_spec.rb +0 -33
- data/spec/models/rspeed/splitter/last_pipe_spec.rb +0 -21
- data/spec/models/rspeed/splitter/pipe_spec.rb +0 -21
- data/spec/models/rspeed/splitter/pipes_spec.rb +0 -27
- data/spec/models/rspeed/splitter/rename_spec.rb +0 -18
- data/spec/models/rspeed/splitter/result_spec.rb +0 -19
- data/spec/models/rspeed/splitter/save_spec.rb +0 -57
- data/spec/rails_helper.rb +0 -43
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Observer, '.after_suite' do
|
4
|
+
context 'when all specs is not finished' do
|
5
|
+
let!(:redis) { redis_object }
|
6
|
+
|
7
|
+
before { allow(RSpeed::Redis).to receive(:specs_finished?).and_return(false) }
|
8
|
+
|
9
|
+
it 'sets true on pipe key to indicates that its finished' do
|
10
|
+
described_class.after_suite
|
11
|
+
|
12
|
+
expect(redis.get('rspeed:pipe_01')).to eq('true')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when all specs finished' do
|
17
|
+
before do
|
18
|
+
allow(RSpeed::Redis).to receive(:specs_finished?).and_return(true)
|
19
|
+
allow(RSpeed::Splitter).to receive(:consolidate)
|
20
|
+
allow(RSpeed::Redis).to receive(:clean)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'consolidates profiles' do
|
24
|
+
described_class.after_suite
|
25
|
+
|
26
|
+
expect(RSpeed::Splitter).to have_received(:consolidate)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'destroyes pipe finished flag keys' do
|
30
|
+
described_class.after_suite
|
31
|
+
|
32
|
+
expect(RSpeed::Redis).to have_received(:clean)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,15 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rails_helper'
|
4
|
-
|
5
3
|
RSpec.describe RSpeed::Observer, '.before_suite' do
|
6
|
-
|
4
|
+
let!(:redis) { redis_object }
|
5
|
+
|
6
|
+
before { truncate_profiles }
|
7
|
+
|
8
|
+
after { truncate_profiles }
|
9
|
+
|
10
|
+
it 'cleans only the current pipe profile' do
|
11
|
+
redis.rpush('rspeed:profile_01', { file: '1_spec.rb', time: 1 }.to_json)
|
12
|
+
redis.rpush('rspeed:profile_02', { file: '2_spec.rb', time: 2 }.to_json)
|
13
|
+
|
14
|
+
described_class.before_suite
|
15
|
+
|
16
|
+
expect(redis.keys).to eq ['rspeed:profile_02']
|
17
|
+
end
|
7
18
|
|
8
|
-
it 'cleans the
|
9
|
-
|
19
|
+
it 'cleans the pipe flag' do
|
20
|
+
redis.set('rspeed:pipe_01', true)
|
21
|
+
redis.set('rspeed:pipe_02', true)
|
10
22
|
|
11
23
|
described_class.before_suite
|
12
24
|
|
13
|
-
expect(
|
25
|
+
expect(redis.keys).to eq ['rspeed:pipe_02']
|
14
26
|
end
|
15
27
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '.clean' do
|
4
|
+
it 'destroys all keys that keeps the pipe finished info' do
|
5
|
+
redis_object.set('rspeed:pipe_01', true)
|
6
|
+
redis_object.set('rspeed:pipe_02', true)
|
7
|
+
|
8
|
+
described_class.clean
|
9
|
+
|
10
|
+
expect(redis_object.keys('*')).to eq([])
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'destroys the pipe profiles' do
|
14
|
+
redis_object.set('rspeed:profile_01', true)
|
15
|
+
|
16
|
+
described_class.clean
|
17
|
+
|
18
|
+
expect(redis_object.keys('*')).to eq([])
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '#destroy' do
|
4
|
+
before do
|
5
|
+
redis_object.set('rspeed', '{}')
|
6
|
+
redis_object.set('rspeed_1', '{}')
|
7
|
+
redis_object.set('rspeed_2', '{}')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'destroys via wildcard' do
|
11
|
+
described_class.destroy(pattern: 'rspeed_*')
|
12
|
+
|
13
|
+
expect(redis_object.keys('*')).to eq %w[rspeed]
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'destroys via single name' do
|
17
|
+
described_class.destroy(pattern: 'rspeed')
|
18
|
+
|
19
|
+
expect(redis_object.keys('*')).to eq %w[rspeed_1 rspeed_2]
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '.keys' do
|
4
|
+
before do
|
5
|
+
redis_object.set('custom_key_1', 'value_1')
|
6
|
+
redis_object.set('custom_key_2', 'value_2')
|
7
|
+
redis_object.set('custom_key_3', 'value_3')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'shows keys' do
|
11
|
+
expect(described_class.keys(pattern: 'custom_key_*')).to eq %w[custom_key_1 custom_key_2 custom_key_3]
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '#list' do
|
4
|
+
let!(:redis) { redis_object }
|
5
|
+
|
6
|
+
before do
|
7
|
+
redis.rpush('key', { file: '1_spec.rb', time: 1.0 }.to_json)
|
8
|
+
redis.rpush('key', { file: '2_spec.rb', time: 2.0 }.to_json)
|
9
|
+
redis.rpush('key', { file: '3_spec.rb', time: 3.0 }.to_json)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'list all key entries' do
|
13
|
+
expect(described_class.list('key')).to eq [
|
14
|
+
'{"file":"1_spec.rb","time":1.0}',
|
15
|
+
'{"file":"2_spec.rb","time":2.0}',
|
16
|
+
'{"file":"3_spec.rb","time":3.0}',
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '#profiles_content' do
|
4
|
+
let!(:redis) { redis_object }
|
5
|
+
|
6
|
+
before do
|
7
|
+
redis.rpush('rspeed:profile_01', { file: '1_spec.rb', time: 1.0 }.to_json)
|
8
|
+
redis.rpush('rspeed:profile_02', { file: '2_spec.rb', time: 2.0 }.to_json)
|
9
|
+
redis.rpush('rspeed:profile_03', { file: '3_spec.rb', time: 3.0 }.to_json)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'returns the content of all profiles keys' do
|
13
|
+
expect(described_class.profiles_content).to eq [
|
14
|
+
'{"file":"1_spec.rb","time":1.0}',
|
15
|
+
'{"file":"2_spec.rb","time":2.0}',
|
16
|
+
'{"file":"3_spec.rb","time":3.0}',
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '#result?' do
|
4
|
+
context 'when has no key rspeed on redis' do
|
5
|
+
it { expect(described_class.result?).to be(false) }
|
6
|
+
end
|
7
|
+
|
8
|
+
context 'when has key rspeed on redis' do
|
9
|
+
before { described_class.set('rspeed', { files: [[1, '1_spec.rb']], number: 0, total: 1 }.to_json) }
|
10
|
+
|
11
|
+
it { expect(described_class.result?).to be(true) }
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '.specs_finished?' do
|
4
|
+
before do
|
5
|
+
described_class.set('rspeed:pipe_01', '1.0')
|
6
|
+
|
7
|
+
allow(RSpeed::Env).to receive(:pipes).and_return(2)
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'when the quantity of pipe result is not the same as the quantity of pipes' do
|
11
|
+
it { expect(described_class.specs_finished?).to be(false) }
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when the quantity of pipe result is the same as the quantity of pipes' do
|
15
|
+
before { described_class.set('rspeed:pipe_02', '2.0') }
|
16
|
+
|
17
|
+
it { expect(described_class.specs_finished?).to be(true) }
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Redis, '.specs_initiated?' do
|
4
|
+
context 'when has no pipe flag key' do
|
5
|
+
it { expect(described_class.specs_finished?).to be(false) }
|
6
|
+
end
|
7
|
+
|
8
|
+
context 'when has at least one pipe flag key' do
|
9
|
+
before { described_class.set('rspeed:pipe_01', '1.0') }
|
10
|
+
|
11
|
+
it { expect(described_class.specs_finished?).to be(true) }
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Runner, '#run' do
|
4
|
+
let!(:shell) { double('shell') }
|
5
|
+
|
6
|
+
before { allow(shell).to receive(:call) }
|
7
|
+
|
8
|
+
context 'when has result' do
|
9
|
+
before { allow(RSpeed::Redis).to receive(:result?).and_return(true) }
|
10
|
+
|
11
|
+
context 'when is the first pipe' do
|
12
|
+
before do
|
13
|
+
allow(RSpeed::Splitter).to receive(:first_pipe?).and_return(true)
|
14
|
+
allow(RSpeed::Splitter).to receive(:pipe_files).and_return('spec_1.rb spec_2.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'runs the pipe specs' do
|
18
|
+
described_class.run(shell)
|
19
|
+
|
20
|
+
expect(shell).to have_received(:call).with('bundle exec rspec spec_1.rb spec_2.rb')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'when is not the first pipe' do
|
25
|
+
before do
|
26
|
+
allow(RSpeed::Splitter).to receive(:first_pipe?).and_return(false)
|
27
|
+
allow(RSpeed::Splitter).to receive(:pipe_files).and_return('spec_1.rb spec_2.rb')
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'runs the pipe specs' do
|
31
|
+
described_class.run(shell)
|
32
|
+
|
33
|
+
expect(shell).to have_received(:call).with('bundle exec rspec spec_1.rb spec_2.rb')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'when has no result' do
|
39
|
+
before do
|
40
|
+
allow(RSpeed::Splitter).to receive(:first_pipe?).and_return(false)
|
41
|
+
allow(RSpeed::Splitter).to receive(:pipe_files).and_return('spec_1.rb spec_2.rb')
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'when is the first pipe' do
|
45
|
+
before { allow(RSpeed::Splitter).to receive(:first_pipe?).and_return(true) }
|
46
|
+
|
47
|
+
it 'runs the pipe specs' do
|
48
|
+
described_class.run(shell)
|
49
|
+
|
50
|
+
expect(shell).to have_received(:call).with('bundle exec rspec spec_1.rb spec_2.rb')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'when is not the first pipe' do
|
55
|
+
before do
|
56
|
+
allow(RSpeed::Splitter).to receive(:first_pipe?).and_return(false)
|
57
|
+
allow(RSpeed::Observer).to receive(:after_suite)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'does not run the pipe specs' do
|
61
|
+
described_class.run(shell)
|
62
|
+
|
63
|
+
expect(shell).not_to have_received(:call)
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'executes the after suite callback' do
|
67
|
+
described_class.run(shell)
|
68
|
+
|
69
|
+
expect(RSpeed::Observer).to have_received(:after_suite)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -1,37 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rails_helper'
|
4
|
-
|
5
3
|
RSpec.describe RSpeed::Splitter, '#append' do
|
6
|
-
|
4
|
+
let!(:redis) { redis_object }
|
7
5
|
|
8
6
|
it 'appends file and time on rspeed key' do
|
9
|
-
|
7
|
+
described_class.append(
|
8
|
+
items: [{ file: '1_spec.rb', time: 1 }.to_json, { file: '2_spec.rb', time: 2 }.to_json],
|
9
|
+
key: 'rspeed'
|
10
|
+
)
|
10
11
|
|
11
|
-
expect(
|
12
|
-
'{"file":"
|
13
|
-
'{"file":"
|
12
|
+
expect(redis.lrange('rspeed', 0, -1)).to eq [
|
13
|
+
'{"file":"1_spec.rb","time":1}',
|
14
|
+
'{"file":"2_spec.rb","time":2}',
|
14
15
|
]
|
15
16
|
end
|
16
|
-
|
17
|
-
context 'when files is not given' do
|
18
|
-
before do
|
19
|
-
clean_csv_file
|
20
|
-
populate_csv_file
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'read csv and append file and time on rspeed key' do
|
24
|
-
splitter.append
|
25
|
-
|
26
|
-
expect(splitter.get('rspeed_tmp')).to eq [
|
27
|
-
'{"file":"./spec/0_2_spec.rb","time":0.2}',
|
28
|
-
'{"file":"./spec/0_3_spec.rb","time":0.3}',
|
29
|
-
'{"file":"./spec/0_4_spec.rb","time":0.4}',
|
30
|
-
'{"file":"./spec/0_7_spec.rb","time":0.7}',
|
31
|
-
'{"file":"./spec/1_1_spec.rb","time":1.1}',
|
32
|
-
'{"file":"./spec/1_5_spec.rb","time":1.5}',
|
33
|
-
'{"file":"./spec/2_0_spec.rb","time":2.0}',
|
34
|
-
]
|
35
|
-
end
|
36
|
-
end
|
37
17
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Splitter, '#consolidate' do
|
4
|
+
let!(:redis) { redis_object }
|
5
|
+
|
6
|
+
before do
|
7
|
+
redis.rpush('rspeed', 'rspeed_content')
|
8
|
+
|
9
|
+
redis.rpush('rspeed:profile_01', { file: '1_spec.rb', time: 1.0 }.to_json)
|
10
|
+
redis.rpush('rspeed:profile_02', { file: '2_spec.rb', time: 2.0 }.to_json)
|
11
|
+
redis.rpush('rspeed:profile_03', { file: '3_spec.rb', time: 3.0 }.to_json)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'copies profiles to the result key cleanning the previous result' do
|
15
|
+
described_class.consolidate
|
16
|
+
|
17
|
+
expect(redis.lrange('rspeed', 0, -1)).to eq [
|
18
|
+
'{"file":"1_spec.rb","time":1.0}',
|
19
|
+
'{"file":"2_spec.rb","time":2.0}',
|
20
|
+
'{"file":"3_spec.rb","time":3.0}',
|
21
|
+
]
|
22
|
+
end
|
23
|
+
end
|
@@ -1,19 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rails_helper'
|
4
|
-
|
5
3
|
RSpec.describe RSpeed::Splitter, '.first_pipe?' do
|
6
|
-
subject(:splitter) { described_class.new }
|
7
|
-
|
8
4
|
context 'when pipe env is 1' do
|
9
|
-
before { allow(
|
5
|
+
before { allow(RSpeed::Env).to receive(:pipe).and_return 1 }
|
10
6
|
|
11
|
-
it { expect(
|
7
|
+
it { expect(described_class.first_pipe?).to eq true }
|
12
8
|
end
|
13
9
|
|
14
10
|
context 'when pipe env is not 1' do
|
15
|
-
before { allow(
|
11
|
+
before { allow(RSpeed::Env).to receive(:pipe).and_return 2 }
|
16
12
|
|
17
|
-
it { expect(
|
13
|
+
it { expect(described_class.first_pipe?).to eq false }
|
18
14
|
end
|
19
15
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe RSpeed::Splitter, '#need_warm?' do
|
4
|
+
context 'when has no result' do
|
5
|
+
before { allow(RSpeed::Redis).to receive(:result?).and_return(false) }
|
6
|
+
|
7
|
+
context 'when is not the first pipe' do
|
8
|
+
before { allow(described_class).to receive(:first_pipe?).and_return(false) }
|
9
|
+
|
10
|
+
it { expect(described_class.need_warm?).to be(false) }
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'when is the first pipe' do
|
14
|
+
before { allow(described_class).to receive(:first_pipe?).and_return(true) }
|
15
|
+
|
16
|
+
it { expect(described_class.need_warm?).to be(true) }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when has result' do
|
21
|
+
before { allow(RSpeed::Redis).to receive(:result?).and_return(true) }
|
22
|
+
|
23
|
+
context 'when is not the first pipe' do
|
24
|
+
before { allow(described_class).to receive(:first_pipe?).and_return(false) }
|
25
|
+
|
26
|
+
it { expect(described_class.need_warm?).to be(false) }
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'when is the first pipe' do
|
30
|
+
before { allow(described_class).to receive(:first_pipe?).and_return(true) }
|
31
|
+
|
32
|
+
it { expect(described_class.need_warm?).to be(false) }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|