spec/lib/pact/app_spec.rb in pact-1.1.1 vs spec/lib/pact/app_spec.rb in pact-1.2.1.rc1
- old
+ new
@@ -14,13 +14,13 @@
let(:subject) { Pact::App.new }
context "when ENV variables are defined" do
before do
- ENV.stub(:[])
- ENV.stub(:[]).with("PACT_DESCRIPTION").and_return(env_description)
- ENV.stub(:[]).with("PACT_PROVIDER_STATE").and_return(env_provider_state)
+ allow(ENV).to receive(:[])
+ allow(ENV).to receive(:[]).with("PACT_DESCRIPTION").and_return(env_description)
+ allow(ENV).to receive(:[]).with("PACT_PROVIDER_STATE").and_return(env_provider_state)
end
it "returns the env vars as regexes" do
expect(SpecCriteria.call).to eq(env_criteria)
end
@@ -32,11 +32,11 @@
end
end
context "when provider state is an empty string" do
before do
- ENV.stub(:[]).with(anything).and_return(nil)
- ENV.stub(:[]).with("PACT_PROVIDER_STATE").and_return('')
+ allow(ENV).to receive(:[]).with(anything).and_return(nil)
+ allow(ENV).to receive(:[]).with("PACT_PROVIDER_STATE").and_return('')
end
it "returns a nil provider state so that it matches a nil provider state on the interaction" do
expect(SpecCriteria.call[:provider_state]).to be_nil
end