Skip to content

Commit 6a04365

Browse files
committed
Update old specs to use expect_ran helper
1 parent a641b10 commit 6a04365

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

spec/figaro/cli/heroku_set_spec.rb

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,14 @@
77

88
it "sends Figaro configuration to Heroku" do
99
run_simple("figaro heroku:set")
10-
11-
command = commands.last
12-
expect(command.name).to eq("heroku")
13-
expect(command.args).to eq(["config:set", "foo=bar"])
10+
expect_ran("heroku", "config:set", "foo=bar")
1411
end
1512

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

1916
run_simple("figaro heroku:set -p env.yml")
20-
21-
command = commands.last
22-
expect(command.name).to eq("heroku")
23-
expect(command.args).to eq(["config:set", "foo=bar"])
17+
expect_ran("heroku", "config:set", "foo=bar")
2418
end
2519

2620
it "respects environment" do
@@ -31,37 +25,23 @@
3125
EOF
3226

3327
run_simple("figaro heroku:set -e test")
34-
35-
command = commands.last
36-
expect(command.name).to eq("heroku")
37-
expect(command.args).to eq(["config:set", "foo=baz"])
28+
expect_ran("heroku", "config:set", "foo=baz")
3829
end
3930

4031
it "targets a specific Heroku app" do
4132
run_simple("figaro heroku:set -a foo-bar-app")
42-
43-
command = commands.last
44-
expect(command.name).to eq("heroku")
45-
expect(command.args.shift).to eq("config:set")
46-
expect(command.args).to match_array(["foo=bar", "--app=foo-bar-app"])
33+
expect_ran("heroku", "config:set", "foo=bar", "--app=foo-bar-app")
4734
end
4835

4936
it "targets a specific Heroku git remote" do
5037
run_simple("figaro heroku:set --remote production")
51-
52-
command = commands.last
53-
expect(command.name).to eq("heroku")
54-
expect(command.args.shift).to eq("config:set")
55-
expect(command.args).to match_array(["foo=bar", "--remote=production"])
38+
expect_ran("heroku", "config:set", "foo=bar", "--remote=production")
5639
end
5740

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

6144
run_simple("figaro heroku:set")
62-
63-
command = commands.last
64-
expect(command.name).to eq("heroku")
65-
expect(command.args).to eq(["config:set", "foo=bar baz"])
45+
expect_ran("heroku", "config:set", "foo=bar baz")
6646
end
6747
end

0 commit comments

Comments
 (0)