summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/parser/functions
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2012-07-23 15:55:08 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-07-23 15:55:08 -0700
commiteffdfb845092fbe549c286926ac686aab1746a12 (patch)
tree66a8607f0e969c1124b81507449f16bb381d9032 /spec/unit/puppet/parser/functions
parent731c07e8768cbe39d75aa55f71fa69a06c6359c2 (diff)
parentfd2ce0d24797b22022ecb14c32ffe88ff70de319 (diff)
downloadpuppet-stdlib-effdfb845092fbe549c286926ac686aab1746a12.tar.gz
puppet-stdlib-effdfb845092fbe549c286926ac686aab1746a12.tar.bz2
Merge branch 'maint/2.3.x/fix_rspec_puppet_load_order_issue' into 2.3.x
* maint/2.3.x/fix_rspec_puppet_load_order_issue: (Maint) Don't mock with mocha
Diffstat (limited to 'spec/unit/puppet/parser/functions')
-rw-r--r--spec/unit/puppet/parser/functions/get_module_path_spec.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/unit/puppet/parser/functions/get_module_path_spec.rb b/spec/unit/puppet/parser/functions/get_module_path_spec.rb
index 0a769eb..e761706 100644
--- a/spec/unit/puppet/parser/functions/get_module_path_spec.rb
+++ b/spec/unit/puppet/parser/functions/get_module_path_spec.rb
@@ -3,6 +3,12 @@ require 'spec_helper'
describe Puppet::Parser::Functions.function(:get_module_path) do
Internals = PuppetlabsSpec::PuppetInternals
+ class StubModule
+ attr_reader :path
+ def initialize(path)
+ @path = path
+ end
+ end
def scope(environment = "production")
Internals.scope(:compiler => Internals.compiler(:node => Internals.node(:environment => environment)))
@@ -17,11 +23,7 @@ describe Puppet::Parser::Functions.function(:get_module_path) do
end
describe 'when locating a module' do
let(:modulepath) { "/tmp/does_not_exist" }
- let(:path_of_module_foo) do
- mod = mock("Puppet::Module")
- mod.stubs(:path).returns("/tmp/does_not_exist/foo")
- mod
- end
+ let(:path_of_module_foo) { StubModule.new("/tmp/does_not_exist/foo") }
before(:each) { Puppet[:modulepath] = modulepath }