Skip to content

Commit

Permalink
Add specs for Elastic Beanstalk command
Browse files Browse the repository at this point in the history
  • Loading branch information
fny committed May 10, 2015
1 parent 766474e commit a641b10
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions spec/figaro/cli/eb_set_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
describe "figaro eb:set" do
before do
create_dir("example")
cd("example")
write_file("config/application.yml", "foo: bar")
end

it "sends Figaro configuration to Elastic Beanstalk" do
run_simple("figaro eb:set")
expect_ran("eb", "setenv", "foo=bar")
end

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

run_simple("figaro eb:set -p env.yml")
expect_ran("eb", "setenv", "foo=bar")
end

it "respects environment" do
overwrite_file("config/application.yml", <<-EOF)
foo: bar
test:
foo: baz
EOF

run_simple("figaro eb:set -e test")
expect_ran("eb", "setenv", "foo=baz")
end

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

run_simple("figaro eb:set")
expect_ran("eb", "setenv", "foo=bar baz")
end

it "targets a Elastic Beanstalk environment" do
run_simple("figaro eb:set --eb-env=beanstalk-env")
expect_ran("eb", "setenv", "foo=bar", "--environment=beanstalk-env")
end

it "targets a specific region" do
run_simple("figaro eb:set --region=us-east-1")
expect_ran("eb", "setenv", "foo=bar", "--region=us-east-1")

run_simple("figaro eb:set -r us-east-1")
expect_ran("eb", "setenv", "foo=bar", "--region=us-east-1")
end

it "targets a specific profile" do
run_simple("figaro eb:set --profile=awesomecreds")
expect_ran("eb", "setenv", "foo=bar", "--profile=awesomecreds")
end

it "respects a given timeout" do
run_simple("figaro eb:set --timeout=1")
expect_ran("eb", "setenv", "foo=bar", "--timeout=1")
end

it "respects a no-verify-ssl" do
run_simple("figaro eb:set --no-verify-ssl")
expect_ran("eb", "setenv", "foo=bar", "--no-verify-ssl")
end
end

0 comments on commit a641b10

Please sign in to comment.