From 0e4ae653c0628cb0df9ccace98bca4bc7478fb7c Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 18 Jul 2011 23:40:17 -0700 Subject: Maint: Fix miscellaneous tests Several tests were broken due to pecularities of Windows and Ruby on Windows: * Ruby on windows does not differentiate between group and other file permissions. * All open file handles must be closed before the file can be deleted * Sometimes the current working directory (Dir.getwd) is reported as C:/foo and other times as C:\\foo, which confuses the spec tests. * Ruby's sprintf formats floating point values differently on Windows vs Unix. The Windows exponent has an extra leading zero. * Needed to stub execution of security command with the SMF service provider. Reviewed-by: Jacob Helwig --- spec/unit/parser/functions/sprintf_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec/unit/parser') 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 -- cgit