license-acceptance 0.2.10 → 0.2.13

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.
@@ -1,65 +0,0 @@
1
- require "spec_helper"
2
- require "license_acceptance/env_acceptance"
3
-
4
- RSpec.describe LicenseAcceptance::EnvAcceptance do
5
- let(:acc) { LicenseAcceptance::EnvAcceptance.new }
6
-
7
- describe "when passed an accept value" do
8
- describe "#accepted?" do
9
- it "returns true if the env contains the correct key and value" do
10
- env = {"CHEF_LICENSE" => "accept"}
11
- expect(acc.accepted?(env)).to eq(true)
12
- end
13
-
14
- it "returns false if the env has a key but nil value" do
15
- env = {"CHEF_LICENSE" => nil}
16
- expect(acc.accepted?(env)).to eq(false)
17
- end
18
-
19
- it "returns false if the env has a key but incorrect value" do
20
- env = {"CHEF_LICENSE" => "foo"}
21
- expect(acc.accepted?(env)).to eq(false)
22
- end
23
- end
24
-
25
- describe "#silent?" do
26
- it "returns true if the env contains the correct key and value" do
27
- env = {"CHEF_LICENSE" => "accept-silent"}
28
- expect(acc.silent?(env)).to eq(true)
29
- end
30
-
31
- it "returns false if the env has a key but nil value" do
32
- env = {"CHEF_LICENSE" => nil}
33
- expect(acc.silent?(env)).to eq(false)
34
- end
35
-
36
- it "returns false if the env has a key but incorrect value" do
37
- env = {"CHEF_LICENSE" => "foo"}
38
- expect(acc.silent?(env)).to eq(false)
39
- env = {"CHEF_LICENSE" => "accept"}
40
- expect(acc.silent?(env)).to eq(false)
41
- end
42
- end
43
-
44
- end
45
-
46
- describe "#no_persist?" do
47
- it "returns true if the env contains the correct key and value" do
48
- env = {"CHEF_LICENSE" => "accept-no-persist"}
49
- expect(acc.no_persist?(env)).to eq(true)
50
- end
51
-
52
- it "returns false if the env has a key but nil value" do
53
- env = {"CHEF_LICENSE" => nil}
54
- expect(acc.no_persist?(env)).to eq(false)
55
- end
56
-
57
- it "returns false if the env has a key but incorrect value" do
58
- env = {"CHEF_LICENSE" => "foo"}
59
- expect(acc.no_persist?(env)).to eq(false)
60
- env = {"CHEF_LICENSE" => "accept"}
61
- expect(acc.no_persist?(env)).to eq(false)
62
- end
63
- end
64
-
65
- end