Skip to content

Commit

Permalink
Scenarios for rebuild + logs commands; temp monkey patch to engineyar…
Browse files Browse the repository at this point in the history
…d code
  • Loading branch information
drnic committed Jul 2, 2010
1 parent bc15f28 commit 9e1c680
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 4 deletions.
20 changes: 20 additions & 0 deletions Support/features/execute_command.feature
Expand Up @@ -5,10 +5,30 @@ Feature: Execution command

Scenario: Deploy current application project (known user/password)
Given I am in an application folder
And I have "one app, one environment"
And it is a git repository with a remote
And I have setup my engineyard email/password for API access
When I execute the "deploy" engineyard command
Then I should see deploy output

Scenario: Rebuild current application
Given I am in an application folder
And I have "one app, one environment"
And it is a git repository with a remote
And I have setup my engineyard email/password for API access
When I execute the "rebuild" engineyard command
Then I should see rebuild output

Scenario: Logs for current application
Given I am in an application folder
And I have "one app, one environment"
And it is a git repository with a remote
And I have setup my engineyard email/password for API access
When I execute the "logs" engineyard command
Then I should see logs output






29 changes: 29 additions & 0 deletions Support/features/step_definitions/api_steps.rb
Expand Up @@ -2,3 +2,32 @@
@token = "TOKEN"
EY::API.save_token @token
end

When /^I have an "empty" app$/ do
api_scenario "empty"
end

When /^I have "one app, one environment, not linked"$/ do
api_scenario "one app, one environment, not linked"
end

When /^I have "one app, one environment"$/ do
api_scenario "one app, one environment"
end

When /^I have "one app, one environment, app master red"$/ do
api_scenario "one app, one environment, app master red"
end

When /^I have "one app, many environments"$/ do
api_scenario "one app, many environments"
end

When /^I have "one app, many similarly-named environments"$/ do
api_scenario "one app, many similarly-named environments"
end





10 changes: 10 additions & 0 deletions Support/features/step_definitions/command_steps.rb
Expand Up @@ -10,3 +10,13 @@
@stdout.should =~ /Beginning deploy for 'rails232app' in 'giblets' on server.../
@stdout.should =~ /Deploy complete/
end

Then /^I should see rebuild output$/ do
pending
end

Then /^I should see logs output$/ do
@stdout.should =~ /MAIN LOG OUTPUT/
@stdout.should =~ /CUSTOM LOG OUTPUT/
end

16 changes: 12 additions & 4 deletions Support/features/support/engineyard.rb
Expand Up @@ -5,13 +5,21 @@
support.each{|helper| require helper }
World(Spec::Helpers)

# temporary monkey patch
module EY
class Repo
def urls
lines = `git config -f #{Escape.shell_command(@path)}/.git/config --get-regexp 'remote.*.url'`.split(/\n/)
raise NoRemotesError.new(@path) if lines.empty?
lines.map { |c| c.split.last }
end
end # Repo
end # EY


ENV["NO_SSH"] = "true"
ENV['CLOUD_URL'] = EY.fake_awsm

Before do
api_scenario "one app, one environment"
end

at_exit do
ENV.delete('CLOUD_URL')
end

0 comments on commit 9e1c680

Please sign in to comment.