summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/functions
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2011-08-19 14:03:56 -0700
committerJosh Cooper <josh@puppetlabs.com>2011-08-19 14:03:56 -0700
commit384302af6dec8c51442f2f29a4c7c555379cd297 (patch)
tree27680b19648100058c752e5fa4136a88a73d7a4f /spec/unit/parser/functions
parent71e190bf255f98e900f7ddd55db393d448df3274 (diff)
parent2091cbeade9d69a18689609f407f9d7f0304dc04 (diff)
Merge branch 'backport-windows-work-to-2.7' into 2.7.x
* backport-windows-work-to-2.7: (60 commits) maint: Fix build break due to recent merge from 2.7.x to master Fix posix exec provider spec failures on Windows (#5495) Remove dead Windows-specific code from posix exec provider Stop trying to make config directories in Windows specs (#8272) Add missing tests for Windows service provider methods. (#8409) Add a default group provider for Windows (#8408) Add a default user provider for Windows (#8408/8409) Add a Windows ADSI helper module (#8663) Exclude exec timeout test on Windows (#8663) Exclude git rev-parse HEAD spec test on Windows Check for the appropriate permissions in File type tests on Windows Remove :fails_on_windows from file type tests that no longer fail on Windows Disable file bucket diffing tests on Windows Always put a slash between the checksum and path in filebucket URLs Treat Windows absolute paths as absolute paths Consolidate test logic determining if a registered file is in the temp directory Clarify logic and error messages when initializing Puppet::FileBucket::File Disable symlink related file tests on Windows (#8644) Host provider on Windows (#8660) Fix destdir option on Windows ...
Diffstat (limited to 'spec/unit/parser/functions')
-rwxr-xr-xspec/unit/parser/functions/extlookup_spec.rb9
-rwxr-xr-xspec/unit/parser/functions/sprintf_spec.rb3
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 f68daaf3f..486e7cb98 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(:lookupvar).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(:lookupvar).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