spec/ey/logs_spec.rb in engineyard-0.4.0 vs spec/ey/logs_spec.rb in engineyard-0.5.0

- old
+ new

@@ -1,45 +1,35 @@ require 'spec_helper' describe "ey logs" do - it_should_behave_like "an integration test" + given "integration" it "prints logs returned by awsm" do api_scenario "one app, one environment" - ey "logs giblets" + ey "logs -e giblets" @out.should match(/MAIN LOG OUTPUT/) @out.should match(/CUSTOM LOG OUTPUT/) @err.should be_empty end - it "can infer the environment" do - api_scenario "one app, one environment" - ey "logs" - @out.should match(/MAIN LOG OUTPUT/) - @out.should match(/CUSTOM LOG OUTPUT/) - @err.should be_empty - end - it "complains when it can't infer the environment" do api_scenario "one app, two environments" ey "logs", :expect_failure => true @err.should =~ /single environment/ end end -describe "ey logs ENV" do - it_should_behave_like "an integration test" +describe "ey logs" do + given "integration" - before(:all) do - api_scenario "one app, many similarly-named environments" + def command_to_run(opts) + cmd = "logs" + cmd << " --environment #{opts[:env]}" if opts[:env] + cmd end - it "works when given an unambiguous substring" do - ey "logs prod" - @out.should match(/MAIN LOG OUTPUT/) + def verify_ran(scenario) + @out.should match(/Main logs for #{scenario[:environment]}/) end - it "complains when given an ambiguous substring" do - ey "logs staging", :hide_err => true, :expect_failure => true - @err.should match(/'staging' is ambiguous/) - end + it_should_behave_like "it takes an environment name" end