Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-static
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-static
Commits
ac036e0c
Commit
ac036e0c
authored
Jul 16, 2015
by
Terence Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for injecting env during testing
parent
706cd68a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
simple_spec.rb
spec/simple_spec.rb
+2
-1
app_runner.rb
spec/support/app_runner.rb
+3
-1
No files found.
spec/simple_spec.rb
View file @
ac036e0c
...
@@ -14,9 +14,10 @@ RSpec.describe "Simple" do
...
@@ -14,9 +14,10 @@ RSpec.describe "Simple" do
app
.
destroy
app
.
destroy
end
end
let
(
:app
)
{
AppRunner
.
new
(
name
,
@debug
)
}
let
(
:app
)
{
AppRunner
.
new
(
name
,
env
,
@debug
)
}
let
(
:name
)
{
"hello_world"
}
let
(
:name
)
{
"hello_world"
}
let
(
:env
)
{
Hash
.
new
}
it
"should serve out of public_html by default"
do
it
"should serve out of public_html by default"
do
response
=
app
.
get
(
"/"
)
response
=
app
.
get
(
"/"
)
...
...
spec/support/app_runner.rb
View file @
ac036e0c
...
@@ -19,11 +19,13 @@ class AppRunner
...
@@ -19,11 +19,13 @@ class AppRunner
HOST_IP
=
boot2docker_ip
||
"127.0.0.1"
HOST_IP
=
boot2docker_ip
||
"127.0.0.1"
CONTAINER_PORT
=
"3000"
CONTAINER_PORT
=
"3000"
def
initialize
(
fixture
,
debug
=
false
)
def
initialize
(
fixture
,
env
=
nil
,
debug
=
false
)
@debug
=
debug
@debug
=
debug
@container
=
Docker
::
Container
.
create
(
@container
=
Docker
::
Container
.
create
(
'Image'
=>
BuildpackBuilder
::
TAG
,
'Image'
=>
BuildpackBuilder
::
TAG
,
'Cmd'
=>
[
"bash"
,
"-c"
,
"cp -rf /src/* /app/ && /app/bin/boot"
],
'Cmd'
=>
[
"bash"
,
"-c"
,
"cp -rf /src/* /app/ && /app/bin/boot"
],
# Env format is [KEY1=VAL1 KEY2=VAL2]
'Env'
=>
env
.
to_a
.
map
{
|
i
|
i
.
join
(
"="
)
},
'HostConfig'
=>
{
'HostConfig'
=>
{
'Binds'
=>
[
"
#{
fixtures_path
(
fixture
)
}
:/src"
],
'Binds'
=>
[
"
#{
fixtures_path
(
fixture
)
}
:/src"
],
'PortBindings'
=>
{
'PortBindings'
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment