From 63703fdf4eb88cd9986884aa6e887181f21d2ee6 Mon Sep 17 00:00:00 2001 From: Roger Oba Date: Sat, 21 Oct 2023 17:49:23 -0300 Subject: [PATCH] Lint. --- spec/arkana_spec.rb | 10 ++++++---- spec/config_parser_spec.rb | 5 +++-- spec/models/arguments_spec.rb | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/spec/arkana_spec.rb b/spec/arkana_spec.rb index 66179f5..b6635b9 100644 --- a/spec/arkana_spec.rb +++ b/spec/arkana_spec.rb @@ -30,8 +30,10 @@ context "when only a subset of environments is included" do before do ARGV.replace([ - "--config-filepath", config_filepath, - "--include-environments", "debug,release,debugPlusMore", + "--config-filepath", + config_filepath, + "--include-environments", + "debug,release,debugPlusMore", ]) config.all_keys.each do |key| @@ -41,8 +43,8 @@ allow(ENV).to receive(:[]).with("ServerReleasePlusMore").and_return(nil) end - it "should not error out when it cant find a missing env var that wasnt included in the list of environments" do - expect { Arkana.run(arguments) }.to_not raise_error + it "does not error out when it cant find a missing env var that wasnt included in the list of environments" do + expect { described_class.run(arguments) }.not_to raise_error end end end diff --git a/spec/config_parser_spec.rb b/spec/config_parser_spec.rb index 9994760..e7bce4c 100644 --- a/spec/config_parser_spec.rb +++ b/spec/config_parser_spec.rb @@ -89,15 +89,16 @@ describe "#include_environments" do describe "when include_environments is specified" do let(:include_environments) { %w[debug debugPlusMore] } + before { ARGV << "--include-environments" << include_environments.join(",") } - it "should include the environments specified, case insensitive" do + it "includes the environments specified, case insensitive" do expect(subject.environments.map(&:downcase)).to match_array(include_environments.map(&:downcase)) end end describe "when include_environments is not specified" do - it "should include all environments" do + it "includes all environments" do all_environments = %w[debug release debugPlusMore ReleasePlusMore] expect(subject.environments.map(&:downcase)).to match_array(all_environments.map(&:downcase)) end diff --git a/spec/models/arguments_spec.rb b/spec/models/arguments_spec.rb index d53ca6b..16727b6 100644 --- a/spec/models/arguments_spec.rb +++ b/spec/models/arguments_spec.rb @@ -73,16 +73,17 @@ describe "#environments" do context "when the option is ommitted in ARGV" do - it "should default to nil" do + it "defaults to nil" do expect(subject.include_environments).to be_nil end end context "when the option is passed in ARGV" do let(:expected_environments) { %w[first_env second_env] } + before { ARGV.replace(["--include-environments", expected_environments.join(",")]) } - it "should return the environments passed as an array, not as a comma-separated string" do + it "returns the environments passed as an array, not as a comma-separated string" do expect(subject.include_environments).to eq expected_environments end end