Switch to current working directory during testing
This commit is contained in:
parent
7c37d4ba51
commit
f4ce1ff99d
2 changed files with 69 additions and 13 deletions
33
middleman-core/features/working_directory.feature
Normal file
33
middleman-core/features/working_directory.feature
Normal file
|
@ -0,0 +1,33 @@
|
|||
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"
|
||||
And a file named "source/index.erb" with:
|
||||
"""
|
||||
<%= 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
|
||||
"""
|
||||
And a file named "source/index.erb" with:
|
||||
"""
|
||||
<%= my_working_directory %>
|
||||
"""
|
||||
And the Server is running
|
||||
When I go to "/index.html"
|
||||
Then I should see:
|
||||
"""
|
||||
aruba
|
||||
"""
|
Loading…
Add table
Add a link
Reference in a new issue