summaryrefslogtreecommitdiff
path: root/spec/unit/provider/service/smf_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune1-1/+1
Without this patch Ruby 1.9 is still complaining loudly about trying to parse the spec files. The previous attempt to clean up this problem in edc3ddf works for Ruby 1.8 but not 1.9. I'd prefer to remove the shebang lines entirely, but doing so will cause encoding errors in Ruby 1.9. This patch strives for a happy middle ground of convincing Ruby it is actually working with Ruby while not confusing it to think it should exec() to rspec. This patch is the result of the following command run against the source tree: find spec -type f -print0 | \ xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
2012-08-06(#10978) add instances to smfrahul1-0/+15
Before the addition of smf instances, the smf service instances were not present in the `puppet resource service` output. Instead it used to collect the legacy init.d services. This commit adds the self.instances method which collects the `svcs` output and parses it to find smf instances. This commit also adds test cases for this feature.
2012-07-02(maint) Standardize on /usr/bin/env ruby -S rspecJeff McCune1-1/+1
Without this patch some spec files are using `ruby -S rspec` and others are using `rspec`. We should standardize on a single form of the interpreter used for spec files. `ruby -S rspec` is the best choice because it correctly informs editors such as Vim with Syntastic that the file is a Ruby file rather than an Rspec file.
2012-04-11Use :as_platform in the smf service specPatrick Carlisle1-3/+1
This spec was stubbing features to make Puppet::Util.absolute_path? behave as if on posix, but changes in #12101 made that method use File::ALT_SEPARATOR. It also introduced the :as_platform context for specs to abstract this type of stubbing.
2011-11-14(#10807) Use SMF's svcadm -s option to wait for errorsDominic Cleal1-3/+3
By default running `svcadm enable example` will start the service in the background and won't return errors if it fails. Using the -s option will cause svcadm to wait and return errors back to the provider if the service cannot start for some reason.
2011-08-23(#8410) Add a helper to Puppet::Util to determine absoluteness of a pathNick Lewis1-0/+2
The method Puppet::Util.absolute_path? accepts a path and an optional platform (:windows or :posix) as an argument. If no platform is given, it will default to the local platform. The method will return true if the path provided is absolute on that platform, and false if it is not. This method is also being used in Puppet::Util.which in lieu of testing against a platform-specific regex inline.
2011-08-19Maint: Fix miscellaneous testsJosh Cooper1-0/+1
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 <jacob@puppetlabs.com> (cherry picked from commit 0e4ae653c0628cb0df9ccace98bca4bc7478fb7c)
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman1-1/+1
We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment.
2011-04-08maint: just require 'spec_helper', thanks rspec2Daniel Pittman1-1/+1
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
2011-02-19Fix non-existent method called in SMF manifest import exception message, ↵Dominic Cleal1-2/+13
updated spec
2011-02-19(#6324) Use real service resource object instead of a stubDominic Cleal1-10/+3
2011-02-18(#6324) Add spec for SMF service providerDominic Cleal1-0/+133