summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/functions/require.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/parser/functions/require.rb')
-rwxr-xr-xspec/unit/parser/functions/require.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/parser/functions/require.rb b/spec/unit/parser/functions/require.rb
index 577a52a42..532c06900 100755
--- a/spec/unit/parser/functions/require.rb
+++ b/spec/unit/parser/functions/require.rb
@@ -13,6 +13,8 @@ describe "the require function" do
@scope.stubs(:resource).returns @resource
@scope.stubs(:findresource)
@scope.stubs(:compiler).returns(@compiler)
+ @klass = stub 'class', :classname => "myclass"
+ @scope.stubs(:find_hostclass).returns(@klass)
end
it "should exist" do
@@ -45,4 +47,13 @@ describe "the require function" do
@scope.function_require("myclass")
end
+
+ it "should lookup the absolute class path" do
+ @scope.stubs(:function_include)
+
+ @scope.expects(:find_hostclass).with("myclass").returns(@klass)
+ @klass.expects(:classname).returns("myclass")
+
+ @scope.function_require("myclass")
+ end
end