Add tests for more implied extensions
This commit is contained in:
parent
df31f65522
commit
63224639d9
|
@ -2,6 +2,8 @@ Feature: Use default extensions when user doesn't supply them
|
||||||
|
|
||||||
Scenario: Default extensions preview
|
Scenario: Default extensions preview
|
||||||
Given the Server is running at "implied-extensions-app"
|
Given the Server is running at "implied-extensions-app"
|
||||||
|
When I go to "/"
|
||||||
|
Then I should see "hello: world"
|
||||||
When I go to "/index.html"
|
When I go to "/index.html"
|
||||||
Then I should see "hello: world"
|
Then I should see "hello: world"
|
||||||
When I go to "/index.erb"
|
When I go to "/index.erb"
|
||||||
|
@ -9,13 +11,15 @@ Feature: Use default extensions when user doesn't supply them
|
||||||
When I go to "/index"
|
When I go to "/index"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
|
|
||||||
Scenario: Default extensions preview
|
Scenario: Override erb extension
|
||||||
Given a fixture app "implied-extensions-app"
|
Given a fixture app "implied-extensions-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
template_extensions :erb => :htm
|
template_extensions :erb => :htm
|
||||||
"""
|
"""
|
||||||
And the Server is running
|
And the Server is running
|
||||||
|
When I go to "/"
|
||||||
|
Then I should see "File Not Found"
|
||||||
When I go to "/index.htm"
|
When I go to "/index.htm"
|
||||||
Then I should see "hello: world"
|
Then I should see "hello: world"
|
||||||
When I go to "/index.erb"
|
When I go to "/index.erb"
|
||||||
|
@ -25,6 +29,19 @@ Feature: Use default extensions when user doesn't supply them
|
||||||
When I go to "/index.html"
|
When I go to "/index.html"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
|
|
||||||
|
Scenario: Override erb extension
|
||||||
|
Given a fixture app "implied-extensions-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
set :index_file, "index.htm"
|
||||||
|
template_extensions :erb => :htm
|
||||||
|
"""
|
||||||
|
And the Server is running
|
||||||
|
When I go to "/"
|
||||||
|
Then I should see "hello: world"
|
||||||
|
When I go to "/index.htm"
|
||||||
|
Then I should see "hello: world"
|
||||||
|
|
||||||
Scenario: Default extensions build
|
Scenario: Default extensions build
|
||||||
Given a fixture app "implied-extensions-app"
|
Given a fixture app "implied-extensions-app"
|
||||||
And a successfully built app at "implied-extensions-app"
|
And a successfully built app at "implied-extensions-app"
|
||||||
|
|
|
@ -33,7 +33,6 @@ module Middleman
|
||||||
if ::Less.const_defined? :Engine
|
if ::Less.const_defined? :Engine
|
||||||
@engine = ::Less::Engine.new(data)
|
@engine = ::Less::Engine.new(data)
|
||||||
else
|
else
|
||||||
$stderr.puts "HEEERE"
|
|
||||||
parser = ::Less::Parser.new(options.merge :filename => eval_file, :line => line, :paths => [".", File.dirname(eval_file)])
|
parser = ::Less::Parser.new(options.merge :filename => eval_file, :line => line, :paths => [".", File.dirname(eval_file)])
|
||||||
@engine = parser.parse(data)
|
@engine = parser.parse(data)
|
||||||
end
|
end
|
||||||
|
|
43
middleman-more/features/implied_extensions.feature
Normal file
43
middleman-more/features/implied_extensions.feature
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
Feature: More default extensions
|
||||||
|
|
||||||
|
Scenario: Default extensions preview
|
||||||
|
Given the Server is running at "implied-extensions-app"
|
||||||
|
When I go to "/test.html"
|
||||||
|
Then I should see "Hello"
|
||||||
|
When I go to "/test2.html"
|
||||||
|
Then I should see "World"
|
||||||
|
When I go to "/test3.html"
|
||||||
|
Then I should see "Howdy"
|
||||||
|
When I go to "/test4.html"
|
||||||
|
Then I should see "HELLO"
|
||||||
|
When I go to "/javascripts/app.js"
|
||||||
|
Then I should see "derp"
|
||||||
|
When I go to "/stylesheets/style.css"
|
||||||
|
Then I should see "section"
|
||||||
|
When I go to "/stylesheets/style2.css"
|
||||||
|
Then I should see "section"
|
||||||
|
When I go to "/stylesheets/style3.css"
|
||||||
|
Then I should see "color"
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Default extensions build
|
||||||
|
Given a fixture app "implied-extensions-app"
|
||||||
|
And a successfully built app at "implied-extensions-app"
|
||||||
|
When I cd to "build"
|
||||||
|
Then the following files should exist:
|
||||||
|
| test.html |
|
||||||
|
| test2.html |
|
||||||
|
| test3.html |
|
||||||
|
| test4.html |
|
||||||
|
| javascripts/app.js |
|
||||||
|
| stylesheets/style.css |
|
||||||
|
| stylesheets/style2.css |
|
||||||
|
| stylesheets/style3.css |
|
||||||
|
And the file "test.html" should contain "Hello"
|
||||||
|
And the file "test2.html" should contain "World"
|
||||||
|
And the file "test3.html" should contain "Howdy"
|
||||||
|
And the file "test4.html" should contain "HELLO"
|
||||||
|
And the file "javascripts/app.js" should contain "derp"
|
||||||
|
And the file "stylesheets/style.css" should contain "section"
|
||||||
|
And the file "stylesheets/style2.css" should contain "section"
|
||||||
|
And the file "stylesheets/style3.css" should contain "color"
|
|
@ -0,0 +1 @@
|
||||||
|
hello = (args...) -> "derp"
|
|
@ -0,0 +1,3 @@
|
||||||
|
@import "compass";
|
||||||
|
|
||||||
|
@include global-reset;
|
|
@ -0,0 +1,3 @@
|
||||||
|
@import "compass"
|
||||||
|
|
||||||
|
+global-reset
|
|
@ -0,0 +1,4 @@
|
||||||
|
@base: #f938ab;
|
||||||
|
.box {
|
||||||
|
color: @base;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
!!!
|
||||||
|
%html
|
||||||
|
%body
|
||||||
|
Hello
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Hello
|
||||||
|
|
||||||
|
## World
|
|
@ -0,0 +1,3 @@
|
||||||
|
html
|
||||||
|
body
|
||||||
|
| Howdy
|
|
@ -0,0 +1 @@
|
||||||
|
{{ 'Hello' | upcase }}
|
Loading…
Reference in a new issue