Skip to content

Commit

Permalink
Lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerluan committed Oct 21, 2023
1 parent 6e9aefd commit 63703fd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions spec/arkana_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions spec/config_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions spec/models/arguments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63703fd

Please sign in to comment.