Sha256: 9bdbfcde865cb181cf12a02f07fb765ca4fb9f6e6c4b20e3323150a40ef1a797
Contents?: true
Size: 748 Bytes
Versions: 7
Compression:
Stored size: 748 Bytes
Contents
#! /usr/bin/env ruby require 'spec_helper' describe 'Puppet::Parser::Functions#hiera' do let :scope do Puppet::Parser::Scope.new_for_test_harness('foo') end it 'should require a key argument' do expect { scope.function_hiera([]) }.to raise_error(Puppet::ParseError) end it 'should raise a useful error when nil is returned' do Hiera.any_instance.expects(:lookup).returns(nil) expect { scope.function_hiera(["badkey"]) }.to raise_error(Puppet::ParseError, /Could not find data item badkey/ ) end it 'should use the priority resolution_type' do Hiera.any_instance.expects(:lookup).with() { |*args| args[4].should be :priority }.returns('foo_result') scope.function_hiera(['key']).should == 'foo_result' end end
Version data entries
7 entries across 7 versions & 1 rubygems