2014-11-02 16:51:44 +01:00
|
|
|
Feature: Honour working directory
|
|
|
|
Honour the working directory during testing
|
|
|
|
In order to support helpers which work with the current directories
|
|
|
|
|
|
|
|
Scenario: Set working directory for helpers in tests
|
|
|
|
Given a fixture app "empty-app"
|
2014-11-19 18:04:56 +01:00
|
|
|
And a file named "source/index.html.erb" with:
|
2014-11-02 16:51:44 +01:00
|
|
|
"""
|
|
|
|
<%= Dir.getwd %>
|
|
|
|
"""
|
|
|
|
And the Server is running
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should see:
|
|
|
|
"""
|
|
|
|
aruba
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: Set working directory for config.rb in tests
|
|
|
|
Given a fixture app "empty-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
set :my_working_directory, Dir.getwd
|
|
|
|
"""
|
2014-11-19 18:04:56 +01:00
|
|
|
And a file named "source/index.html.erb" with:
|
2014-11-02 16:51:44 +01:00
|
|
|
"""
|
2014-11-19 18:04:56 +01:00
|
|
|
<%= config[:my_working_directory] %>
|
2014-11-02 16:51:44 +01:00
|
|
|
"""
|
|
|
|
And the Server is running
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should see:
|
|
|
|
"""
|
|
|
|
aruba
|
|
|
|
"""
|