diff options
Diffstat (limited to 'spec/unit/parser/functions')
| -rwxr-xr-x | spec/unit/parser/functions/extlookup_spec.rb | 9 | ||||
| -rwxr-xr-x | spec/unit/parser/functions/sprintf_spec.rb | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/spec/unit/parser/functions/extlookup_spec.rb b/spec/unit/parser/functions/extlookup_spec.rb index 30962e137..59ecf39c0 100755 --- a/spec/unit/parser/functions/extlookup_spec.rb +++ b/spec/unit/parser/functions/extlookup_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' require 'tempfile' describe "the extlookup function" do + include PuppetSpec::Files + before :all do Puppet::Parser::Functions.autoloader.loadall end @@ -64,9 +66,10 @@ describe "the extlookup function" do describe "should look in $extlookup_datadir for data files listed by $extlookup_precedence" do before do - @scope.stubs(:[]).with('::extlookup_datadir').returns("/tmp") - File.open("/tmp/one.csv","w"){|one| one.puts "key,value1" } - File.open("/tmp/two.csv","w") do |two| + dir = tmpdir('extlookup_datadir') + @scope.stubs(:[]).with('::extlookup_datadir').returns(dir) + File.open(File.join(dir, "one.csv"),"w"){|one| one.puts "key,value1" } + File.open(File.join(dir, "two.csv"),"w") do |two| two.puts "key,value2" two.puts "key2,value_two" end diff --git a/spec/unit/parser/functions/sprintf_spec.rb b/spec/unit/parser/functions/sprintf_spec.rb index bd4863f23..3351c7fb3 100755 --- a/spec/unit/parser/functions/sprintf_spec.rb +++ b/spec/unit/parser/functions/sprintf_spec.rb @@ -30,7 +30,8 @@ describe "the sprintf function" do it "should format large floats" do result = @scope.function_sprintf(["%+.2e", "27182818284590451"]) - result.should(eql("+2.72e+16")) + str = Puppet.features.microsoft_windows? ? "+2.72e+016" : "+2.72e+16" + result.should(eql(str)) end it "should perform more complex formatting" do |
