From 27d0c5470f75959fc9e680115bef1349f25319ea Mon Sep 17 00:00:00 2001 From: Roger Oba Date: Sat, 21 Oct 2023 17:02:32 -0300 Subject: [PATCH] Lint. --- lib/arkana/models/config.rb | 1 + spec/config_parser_spec.rb | 4 ++-- spec/models/arguments_spec.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/arkana/models/config.rb b/lib/arkana/models/config.rb index 8840545..55196ba 100644 --- a/lib/arkana/models/config.rb +++ b/lib/arkana/models/config.rb @@ -66,6 +66,7 @@ def all_keys def include_environments(environments) return unless environments + @environments = @environments.select { |e| environments.map(&:downcase).include?(e.downcase) } end end diff --git a/spec/config_parser_spec.rb b/spec/config_parser_spec.rb index 373db2a..3b91d20 100644 --- a/spec/config_parser_spec.rb +++ b/spec/config_parser_spec.rb @@ -84,7 +84,7 @@ describe "#include_environments" do describe "when include_environments is specified" do - let(:include_environments) { ["debug", "debugPlusMore"] } + let(:include_environments) { %w[debug debugPlusMore] } before { ARGV << "--include-environments" << include_environments.join(",") } it "should include the environments specified, case insensitive" do @@ -94,7 +94,7 @@ describe "when include_environments is not specified" do it "should include all environments" do - all_environments = ["debug", "release", "debugPlusMore", "ReleasePlusMore"] + all_environments = %w[debug release debugPlusMore ReleasePlusMore] expect(subject.environments.map(&:downcase)).to match_array(all_environments.map(&:downcase)) end end diff --git a/spec/models/arguments_spec.rb b/spec/models/arguments_spec.rb index 9720d7b..5ac7daa 100644 --- a/spec/models/arguments_spec.rb +++ b/spec/models/arguments_spec.rb @@ -75,7 +75,7 @@ end context "when the option is passed in ARGV" do - let(:expected_environments) { ["first_env", "second_env"] } + 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