From 5d3a40fda87b7346d99fd25c0eb1906a62c19512 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 (cherry picked from commit 0e4ae653c0628cb0df9ccace98bca4bc7478fb7c) --- spec/unit/provider/service/smf_spec.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/unit/provider/service/smf_spec.rb') diff --git a/spec/unit/provider/service/smf_spec.rb b/spec/unit/provider/service/smf_spec.rb index 5212d540a..fd7d50e3a 100755 --- a/spec/unit/provider/service/smf_spec.rb +++ b/spec/unit/provider/service/smf_spec.rb @@ -111,6 +111,7 @@ describe provider_class do it "should import the manifest if service is missing" do @provider.expects(:svccfg).with(:import, "/tmp/myservice.xml") @provider.expects(:texecute).with(:start, ["/usr/sbin/svcadm", :enable, "/system/myservice"], true) + @provider.expects(:svcs).with('-H', '-o', 'state,nstate', "/system/myservice").returns("online\t-") @provider.start end -- cgit