add test for helpers in external files

This commit is contained in:
Thomas Reynolds 2011-12-06 10:28:55 -08:00
parent 6aac51f6f0
commit 9b07bf24dd
5 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,6 @@
Feature: Helpers in external files
Scenario: Hello Helper
Given the Server is running at "external-helpers"
Then going to "/index.html" should not raise an exception
And I should see "Hello World"

View file

@ -0,0 +1,4 @@
require "lib/hello_helper"
helpers HelloHelper
page "/", :layout => false

View file

@ -0,0 +1,5 @@
module HelloHelper
def hello
"Hello World"
end
end

View file

@ -0,0 +1 @@
<%= hello %>

View file

@ -94,6 +94,9 @@ module Middleman::CoreExtensions::Extensions
run_hook :before_configuration run_hook :before_configuration
# Search the root of the project for required files
$LOAD_PATH.unshift(root)
# Check for and evaluate local configuration # Check for and evaluate local configuration
local_config = File.join(root, "config.rb") local_config = File.join(root, "config.rb")
if File.exists? local_config if File.exists? local_config