|
7 | 7 |
|
8 | 8 | it "sends Figaro configuration to Heroku" do |
9 | 9 | 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") |
14 | 11 | end |
15 | 12 |
|
16 | 13 | it "respects path" do |
17 | 14 | write_file("env.yml", "foo: bar") |
18 | 15 |
|
19 | 16 | 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") |
24 | 18 | end |
25 | 19 |
|
26 | 20 | it "respects environment" do |
|
31 | 25 | EOF |
32 | 26 |
|
33 | 27 | 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") |
38 | 29 | end |
39 | 30 |
|
40 | 31 | it "targets a specific Heroku app" do |
41 | 32 | 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") |
47 | 34 | end |
48 | 35 |
|
49 | 36 | it "targets a specific Heroku git remote" do |
50 | 37 | 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") |
56 | 39 | end |
57 | 40 |
|
58 | 41 | it "handles values with special characters" do |
59 | 42 | overwrite_file("config/application.yml", "foo: bar baz") |
60 | 43 |
|
61 | 44 | 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") |
66 | 46 | end |
67 | 47 | end |
0 commit comments