Skip to content

Commit

Permalink
dont fail tests when Procfile is present in foreman dir (closes #771)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Apr 12, 2024
1 parent 0590629 commit 3a26271
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/foreman/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,24 @@

describe "run" do
it "can run a command" do
expect(forked_foreman("run echo 1")).to eq("1\n")
expect(forked_foreman("run -f #{resource_path("Procfile")} echo 1")).to eq("1\n")
end

it "doesn't parse options for the command" do
expect(forked_foreman("run grep -e FOO #{resource_path(".env")}")).to eq("FOO=bar\n")
expect(forked_foreman("run -f #{resource_path("Procfile")} grep -e FOO #{resource_path(".env")}")).to eq("FOO=bar\n")
end

it "includes the environment" do
expect(forked_foreman("run -e #{resource_path(".env")} #{resource_path("bin/env FOO")}")).to eq("bar\n")
expect(forked_foreman("run -f #{resource_path("Procfile")} -e #{resource_path(".env")} #{resource_path("bin/env FOO")}")).to eq("bar\n")
end

it "can run a command from the Procfile" do
expect(forked_foreman("run -f #{resource_path("Procfile")} test")).to eq("testing\n")
end

it "exits with the same exit code as the command" do
expect(fork_and_get_exitstatus("run echo 1")).to eq(0)
expect(fork_and_get_exitstatus("run date 'invalid_date'")).to eq(1)
expect(fork_and_get_exitstatus("run -f #{resource_path("Procfile")} echo 1")).to eq(0)
expect(fork_and_get_exitstatus("run -f #{resource_path("Procfile")} date 'invalid_date'")).to eq(1)
end
end

Expand Down

0 comments on commit 3a26271

Please sign in to comment.