diff --git a/middleman-core/features/implied_extensions.feature b/middleman-core/features/implied_extensions.feature index 815d6745..63d4e5c4 100644 --- a/middleman-core/features/implied_extensions.feature +++ b/middleman-core/features/implied_extensions.feature @@ -2,6 +2,8 @@ Feature: Use default extensions when user doesn't supply them Scenario: Default extensions preview 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" Then I should see "hello: world" 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" Then I should see "File Not Found" - Scenario: Default extensions preview + Scenario: Override erb extension Given a fixture app "implied-extensions-app" And a file named "config.rb" with: """ template_extensions :erb => :htm """ And the Server is running + When I go to "/" + Then I should see "File Not Found" When I go to "/index.htm" Then I should see "hello: world" When I go to "/index.erb" @@ -24,6 +28,19 @@ Feature: Use default extensions when user doesn't supply them Then I should see "File Not Found" When I go to "/index.html" 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 Given a fixture app "implied-extensions-app" diff --git a/middleman-core/lib/middleman-core/renderers/less.rb b/middleman-core/lib/middleman-core/renderers/less.rb index 52faf0e1..96f9cebb 100644 --- a/middleman-core/lib/middleman-core/renderers/less.rb +++ b/middleman-core/lib/middleman-core/renderers/less.rb @@ -33,7 +33,6 @@ module Middleman if ::Less.const_defined? :Engine @engine = ::Less::Engine.new(data) else - $stderr.puts "HEEERE" parser = ::Less::Parser.new(options.merge :filename => eval_file, :line => line, :paths => [".", File.dirname(eval_file)]) @engine = parser.parse(data) end diff --git a/middleman-more/features/implied_extensions.feature b/middleman-more/features/implied_extensions.feature new file mode 100644 index 00000000..785a6d7b --- /dev/null +++ b/middleman-more/features/implied_extensions.feature @@ -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" \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/config.rb b/middleman-more/fixtures/implied-extensions-app/config.rb new file mode 100644 index 00000000..e69de29b diff --git a/middleman-more/fixtures/implied-extensions-app/source/javascripts/app.coffee b/middleman-more/fixtures/implied-extensions-app/source/javascripts/app.coffee new file mode 100644 index 00000000..bd6d320d --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/javascripts/app.coffee @@ -0,0 +1 @@ +hello = (args...) -> "derp" \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style.scss b/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style.scss new file mode 100644 index 00000000..d8847a80 --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style.scss @@ -0,0 +1,3 @@ +@import "compass"; + +@include global-reset; \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style2.sass b/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style2.sass new file mode 100644 index 00000000..661ca0a8 --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style2.sass @@ -0,0 +1,3 @@ +@import "compass" + ++global-reset \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style3.less b/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style3.less new file mode 100644 index 00000000..420d50d4 --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/stylesheets/style3.less @@ -0,0 +1,4 @@ +@base: #f938ab; +.box { + color: @base; +} \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/source/test.haml b/middleman-more/fixtures/implied-extensions-app/source/test.haml new file mode 100644 index 00000000..b79ea27c --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/test.haml @@ -0,0 +1,4 @@ +!!! +%html + %body + Hello \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/source/test2.markdown b/middleman-more/fixtures/implied-extensions-app/source/test2.markdown new file mode 100644 index 00000000..763a7558 --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/test2.markdown @@ -0,0 +1,3 @@ +# Hello + +## World \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/source/test3.slim b/middleman-more/fixtures/implied-extensions-app/source/test3.slim new file mode 100644 index 00000000..69eaa720 --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/test3.slim @@ -0,0 +1,3 @@ +html + body + | Howdy \ No newline at end of file diff --git a/middleman-more/fixtures/implied-extensions-app/source/test4.liquid b/middleman-more/fixtures/implied-extensions-app/source/test4.liquid new file mode 100644 index 00000000..dab9ce8f --- /dev/null +++ b/middleman-more/fixtures/implied-extensions-app/source/test4.liquid @@ -0,0 +1 @@ +{{ 'Hello' | upcase }} \ No newline at end of file