blob: 9283686286454e0311f3fdc439ef406a63da279f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# frozen_string_literal: true
RSpec.describe QA::Runtime::Namespace do
include Helpers::StubENV
describe '.name' do
context 'when CACHE_NAMESPACE_NAME is not defined' do
before do
stub_env('CACHE_NAMESPACE_NAME', nil)
end
it 'caches name by default' do
name = described_class.name
expect(described_class.name).to eq(name)
end
it 'does not cache name when reset_cache is true' do
name = described_class.name
expect(described_class.name(reset_cache: true)).not_to eq(name)
end
end
context 'when CACHE_NAMESPACE_NAME is defined' do
before do
stub_env('CACHE_NAMESPACE_NAME', 'true')
end
it 'caches name by default' do
name = described_class.name
expect(described_class.name).to eq(name)
end
it 'caches name when reset_cache is false' do
name = described_class.name
expect(described_class.name(reset_cache: false)).to eq(name)
end
it 'does not cache name when reset_cache is true' do
name = described_class.name
expect(described_class.name(reset_cache: true)).not_to eq(name)
end
end
end
describe '.path' do
it 'is always cached' do
path = described_class.path
expect(described_class.path).to eq(path)
end
end
end
|