Skip to content

Commit

Permalink
Update old specs to use expect_ran helper
Browse files Browse the repository at this point in the history
  • Loading branch information
fny committed May 10, 2015
1 parent a641b10 commit 6a04365
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions spec/figaro/cli/heroku_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@

it "sends Figaro configuration to Heroku" do
run_simple("figaro heroku:set")

command = commands.last
expect(command.name).to eq("heroku")
expect(command.args).to eq(["config:set", "foo=bar"])
expect_ran("heroku", "config:set", "foo=bar")
end

it "respects path" do
write_file("env.yml", "foo: bar")

run_simple("figaro heroku:set -p env.yml")

command = commands.last
expect(command.name).to eq("heroku")
expect(command.args).to eq(["config:set", "foo=bar"])
expect_ran("heroku", "config:set", "foo=bar")
end

it "respects environment" do
Expand All @@ -31,37 +25,23 @@
EOF

run_simple("figaro heroku:set -e test")

command = commands.last
expect(command.name).to eq("heroku")
expect(command.args).to eq(["config:set", "foo=baz"])
expect_ran("heroku", "config:set", "foo=baz")
end

it "targets a specific Heroku app" do
run_simple("figaro heroku:set -a foo-bar-app")

command = commands.last
expect(command.name).to eq("heroku")
expect(command.args.shift).to eq("config:set")
expect(command.args).to match_array(["foo=bar", "--app=foo-bar-app"])
expect_ran("heroku", "config:set", "foo=bar", "--app=foo-bar-app")
end

it "targets a specific Heroku git remote" do
run_simple("figaro heroku:set --remote production")

command = commands.last
expect(command.name).to eq("heroku")
expect(command.args.shift).to eq("config:set")
expect(command.args).to match_array(["foo=bar", "--remote=production"])
expect_ran("heroku", "config:set", "foo=bar", "--remote=production")
end

it "handles values with special characters" do
overwrite_file("config/application.yml", "foo: bar baz")

run_simple("figaro heroku:set")

command = commands.last
expect(command.name).to eq("heroku")
expect(command.args).to eq(["config:set", "foo=bar baz"])
expect_ran("heroku", "config:set", "foo=bar baz")
end
end

0 comments on commit 6a04365

Please sign in to comment.