Skip to content

Commit a641b10

Browse files
committed
Add specs for Elastic Beanstalk command
1 parent 766474e commit a641b10

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

spec/figaro/cli/eb_set_spec.rb

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
describe "figaro eb:set" do
2+
before do
3+
create_dir("example")
4+
cd("example")
5+
write_file("config/application.yml", "foo: bar")
6+
end
7+
8+
it "sends Figaro configuration to Elastic Beanstalk" do
9+
run_simple("figaro eb:set")
10+
expect_ran("eb", "setenv", "foo=bar")
11+
end
12+
13+
it "respects path" do
14+
write_file("env.yml", "foo: bar")
15+
16+
run_simple("figaro eb:set -p env.yml")
17+
expect_ran("eb", "setenv", "foo=bar")
18+
end
19+
20+
it "respects environment" do
21+
overwrite_file("config/application.yml", <<-EOF)
22+
foo: bar
23+
test:
24+
foo: baz
25+
EOF
26+
27+
run_simple("figaro eb:set -e test")
28+
expect_ran("eb", "setenv", "foo=baz")
29+
end
30+
31+
it "handles values with special characters" do
32+
overwrite_file("config/application.yml", "foo: bar baz")
33+
34+
run_simple("figaro eb:set")
35+
expect_ran("eb", "setenv", "foo=bar baz")
36+
end
37+
38+
it "targets a Elastic Beanstalk environment" do
39+
run_simple("figaro eb:set --eb-env=beanstalk-env")
40+
expect_ran("eb", "setenv", "foo=bar", "--environment=beanstalk-env")
41+
end
42+
43+
it "targets a specific region" do
44+
run_simple("figaro eb:set --region=us-east-1")
45+
expect_ran("eb", "setenv", "foo=bar", "--region=us-east-1")
46+
47+
run_simple("figaro eb:set -r us-east-1")
48+
expect_ran("eb", "setenv", "foo=bar", "--region=us-east-1")
49+
end
50+
51+
it "targets a specific profile" do
52+
run_simple("figaro eb:set --profile=awesomecreds")
53+
expect_ran("eb", "setenv", "foo=bar", "--profile=awesomecreds")
54+
end
55+
56+
it "respects a given timeout" do
57+
run_simple("figaro eb:set --timeout=1")
58+
expect_ran("eb", "setenv", "foo=bar", "--timeout=1")
59+
end
60+
61+
it "respects a no-verify-ssl" do
62+
run_simple("figaro eb:set --no-verify-ssl")
63+
expect_ran("eb", "setenv", "foo=bar", "--no-verify-ssl")
64+
end
65+
end

0 commit comments

Comments
 (0)