forked from pmenglund/vcap-tests
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test that rack apps work and require a Gemfile Needs verification and still need a better way to communicate missing gemfile from CC to client...
- Loading branch information
Ezra Zygmuntowicz
committed
May 13, 2011
1 parent
0550e5d
commit 561807b
Showing
9 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source "http://rubygems.org" | ||
|
||
gem "rack" | ||
gem "thin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require File.join(File.dirname(__FILE__), 'simple_rack_app') | ||
run SimpleRackApp.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class SimpleRackApp | ||
|
||
def call(env) | ||
[200, {'Content-Type' => 'text/html'}, ['hello']] | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require File.join(File.dirname(__FILE__), 'simple_rack_app') | ||
run SimpleRackApp.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class SimpleRackApp | ||
|
||
def call(env) | ||
[200, {'Content-Type' => 'text/html'}, ['hello']] | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Feature: Ensure that Rack Applications are fully supported on AppCloud | ||
|
||
As a user of AppCloud | ||
I want to create applications using bare rack framework bare | ||
|
||
Background: Rack Application creation | ||
Given I have registered and logged in | ||
|
||
@creates_rack_app | ||
Scenario: start and test a rack app with Gemfile | ||
Given I have deployed a rack application | ||
Then The rack app should work | ||
|
||
@creates_rack_broken_no_gemfile_app | ||
Scenario: get crash information for a broken rack application with no Gemfile | ||
Given I have deployed a broken rack application missing a Gemfile | ||
When I get crash information for my application | ||
Then I should be able to know that it failed because I am missing a Gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
When /^I create a rack application$/ do | ||
@app = create_app RACK_APP, @token | ||
end | ||
|
||
Given /^I have deployed a rack application$/ do | ||
@app = create_app RACK_APP, @token | ||
upload_app @app, @token | ||
start_app @app, @token | ||
expected_health = 1.0 | ||
health = poll_until_done @app, expected_health, @token | ||
health.should == expected_health | ||
end | ||
|
||
Then /^The rack app should work$/ do | ||
response = get_app_contents @app, '/' | ||
response.should_not == nil | ||
response.response_code.should == 200 | ||
response.body_str.should == 'hello' | ||
end | ||
|
||
# Crash info for a broken (persistently broken) rack app with no Gemfile | ||
Given /^I have deployed a broken rack application missing a Gemfile$/ do | ||
@app = create_app RACK_BROKEN_NO_GEMFILE_APP, @token | ||
upload_app @app, @token | ||
start_app @app, @token | ||
sleep 3 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters