-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathnsc_spec.rb
More file actions
55 lines (47 loc) · 1.53 KB
/
Copy pathnsc_spec.rb
File metadata and controls
55 lines (47 loc) · 1.53 KB
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
52
53
54
55
require "rails_helper"
RSpec.describe Nsc do
describe ".disabled?" do
it "returns false when NSC_DISABLED is unset" do
stub_environment_variable("NSC_DISABLED", nil) do
expect(described_class.disabled?).to be false
end
end
it "returns false when NSC_DISABLED is 'false'" do
stub_environment_variable("NSC_DISABLED", "false") do
expect(described_class.disabled?).to be false
end
end
it "returns false when NSC_DISABLED is '0'" do
stub_environment_variable("NSC_DISABLED", "0") do
expect(described_class.disabled?).to be false
end
end
it "returns true when NSC_DISABLED is 'true'" do
stub_environment_variable("NSC_DISABLED", "true") do
expect(described_class.disabled?).to be true
end
end
it "returns true when NSC_DISABLED is '1'" do
stub_environment_variable("NSC_DISABLED", "1") do
expect(described_class.disabled?).to be true
end
end
it "returns true when NSC_DISABLED is 't'" do
stub_environment_variable("NSC_DISABLED", "t") do
expect(described_class.disabled?).to be true
end
end
end
describe ".enabled?" do
it "returns true when NSC_DISABLED is unset" do
stub_environment_variable("NSC_DISABLED", nil) do
expect(described_class.enabled?).to be true
end
end
it "returns false when NSC_DISABLED is 'true'" do
stub_environment_variable("NSC_DISABLED", "true") do
expect(described_class.enabled?).to be false
end
end
end
end