@@ -10,7 +10,6 @@ module PactBroker
10
10
subject { FeatureToggle . enabled? ( :foo ) }
11
11
12
12
context "when RACK_ENV is not production" do
13
-
14
13
before do
15
14
allow ( ENV ) . to receive ( :[] ) . with ( 'RACK_ENV' ) . and_return ( 'development' )
16
15
end
@@ -23,13 +22,13 @@ module PactBroker
23
22
it { is_expected . to be true }
24
23
end
25
24
26
- context "when PACT_BROKER_FEATURES does not include the given string" do
27
- before do
28
- allow ( ENV ) . to receive ( :[] ) . with ( 'PACT_BROKER_FEATURES' ) . and_return ( nil )
29
- end
25
+ context "when PACT_BROKER_FEATURES does not include the given string" do
26
+ before do
27
+ allow ( ENV ) . to receive ( :[] ) . with ( 'PACT_BROKER_FEATURES' ) . and_return ( nil )
28
+ end
30
29
31
- it { is_expected . to be true }
32
- end
30
+ it { is_expected . to be true }
31
+ end
33
32
end
34
33
35
34
context "when RACK_ENV is production" do
@@ -45,6 +44,23 @@ module PactBroker
45
44
it { is_expected . to be true }
46
45
end
47
46
47
+ context "when PACT_BROKER_FEATURES includes the given string inside another word" do
48
+ before do
49
+ allow ( ENV ) . to receive ( :[] ) . with ( 'PACT_BROKER_FEATURES' ) . and_return ( 'foowiffle bar' )
50
+ end
51
+
52
+ it { is_expected . to be false }
53
+ end
54
+
55
+ context "when PACT_BROKER_FEATURES includes the given string but the case doesn't match" do
56
+ before do
57
+ allow ( ENV ) . to receive ( :[] ) . with ( 'PACT_BROKER_FEATURES' ) . and_return ( 'FOO bar' )
58
+ end
59
+
60
+ it { is_expected . to be true }
61
+ end
62
+
63
+
48
64
context "when PACT_BROKER_FEATURES does not include the given string" do
49
65
before do
50
66
allow ( ENV ) . to receive ( :[] ) . with ( 'PACT_BROKER_FEATURES' ) . and_return ( nil )
0 commit comments