Skip to content

Commit

Permalink
[now-ruby] Add rack examples to ruby integration tests (#3626)
Browse files Browse the repository at this point in the history
* add rack examples to ruby integration tests
  * https://github.com/rack/rack

Co-authored-by: Steven <steven@ceriously.com>
  • Loading branch information
m5o and styfle committed Jan 27, 2020
1 parent 9aad701 commit 882bc8c
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/now-ruby/test/fixtures/07-rack/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "rack", "~> 2.0"
13 changes: 13 additions & 0 deletions packages/now-ruby/test/fixtures/07-rack/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
rack (2.1.1)

PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.0)

BUNDLED WITH
1.17.3
7 changes: 7 additions & 0 deletions packages/now-ruby/test/fixtures/07-rack/index.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class RackApp
def call(env)
[ 200, { "Content-Type" => "text/plain" }, ["gem:RANDOMNESS_PLACEHOLDER"] ]
end
end

run RackApp.new
5 changes: 5 additions & 0 deletions packages/now-ruby/test/fixtures/07-rack/now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": 2,
"builds": [{ "src": "index.ru", "use": "@now/ruby" }],
"probes": [{ "path": "/", "mustContain": "gem:RANDOMNESS_PLACEHOLDER" }]
}
3 changes: 3 additions & 0 deletions packages/now-ruby/test/fixtures/08-rack-proc/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "rack", "~> 2.0"
13 changes: 13 additions & 0 deletions packages/now-ruby/test/fixtures/08-rack-proc/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
rack (2.1.1)

PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.0)

BUNDLED WITH
1.17.3
1 change: 1 addition & 0 deletions packages/now-ruby/test/fixtures/08-rack-proc/index.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run ->(env) { [200, {"Content-Type" => "text/plain"}, ["gem:RANDOMNESS_PLACEHOLDER"]] }
5 changes: 5 additions & 0 deletions packages/now-ruby/test/fixtures/08-rack-proc/now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": 2,
"builds": [{ "src": "index.ru", "use": "@now/ruby" }],
"probes": [{ "path": "/", "mustContain": "gem:RANDOMNESS_PLACEHOLDER" }]
}

1 comment on commit 882bc8c

@vercel
Copy link

@vercel vercel bot commented on 882bc8c Jan 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.