From 991d0a2fe7aba8930a817bf11f5b1b86551b9a8e Mon Sep 17 00:00:00 2001 From: Geoff Harcourt Date: Wed, 23 Feb 2022 13:57:45 -0500 Subject: [PATCH] Fix specs for new default branch, bump development Ruby -> 2.7.2 Since the default branch became `main`, some specs that relied on the default being `master` were failing. This change adds setup for examples that depend on the old `master` branch being the default branch so that the specs continue to work for both cases. Bump the development version of Ruby to 2.7.2. --- .ruby-version | 2 +- spec/parity/environment_spec.rb | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index aedc15b..37c2961 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.3 +2.7.2 diff --git a/spec/parity/environment_spec.rb b/spec/parity/environment_spec.rb index 89bdc1f..b5df78d 100644 --- a/spec/parity/environment_spec.rb +++ b/spec/parity/environment_spec.rb @@ -233,13 +233,21 @@ it "returns false if the deploy was not succesful" do allow(Kernel).to receive(:system).with(git_push).and_return(false) - result = Parity::Environment.new("production", ["deploy"]).run + env = Parity::Environment.new("production", ["deploy"]) + + allow(env).to receive(:branch_ref).and_return("master") + + result = env.run expect(result).to eq(false) end it "deploys feature branches to staging's master for evaluation" do - Parity::Environment.new("staging", ["deploy"]).run + env = Parity::Environment.new("staging", ["deploy"]) + + allow(env).to receive(:branch_ref).and_return("master") + + env.run expect(Kernel).to have_received(:system).with(git_push_feature_branch) end