summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package/sun_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2013-05-13(#19760) Remove unnecessary stubbing in sun_specStefan Schulte1-8/+0
We do not have to stub the `command` method anymore because it is nevery called directly. It is only called through the wrapper method `pkginfo` which we already stub in the specs.
2013-05-13(#19760) Use pkginfo method instead of executeStefan Schulte1-7/+7
The pkginfo method is automatically created for us and provides a nice wrapper around execute so prefer that one over building your own execute method invocation. Please not that the buildin method does already set combine to true so we are able to parse error messages
2013-05-13(#19760) Use combine when running pkginfoStefan Schulte1-4/+4
pkginfo was previously executed with combine => false so stderr was discarded. This way puppet was unable to detect any errors the pkginfo might print, especially the message `ERROR: information for "some_package" was not found`. As a result the provider failed every time it tries to check the current state of an absent package.
2012-11-15(#17007) Make failonfail and combine explicitJosh Cooper1-4/+4
Previously, many providers called Puppet::Util.execute with an argument(s), which had the side-effect of defaulting failonfail and combine to false. This commit does not change any behavior. Instead in places where execute is called with arguments, it explicitly sets failonfail and/or combine to false. This way it's less confusing as to what the provider is doing.
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-10(#8288) pkgadd - allow -G to be specified as an install optionRahul Gopinath1-0/+8
Before implementing this feature, pkgadd solaris could not specify { install_options=>options } as extra options in package manifest for puppet. This checkin adds the :install_option feature to the provider which enables the use of { install_options=> options } parameter. This checkin also adds the test cases for this feature.
2012-08-09(Maint) Simplify spec testJosh Cooper1-14/+8
Modified the spec test to use the `described_class` method of the example group. Also simplified how the `resource` and `provider` were declared in the `let` blocks.
2012-08-09(#15686) Test for package provider featuresJosh Cooper1-1/+7
This commit adds tests to ensure that the sun package provider features are correct: installable, uninstallable, and upgradeable, but not versionable.
2012-08-09(#15686) Ensure exception message is a stringRahul Gopinath1-0/+114
Previously the execpipe method used to return an array as output, which if the child exit status was non-zero, caused an exception to be raised with the array as the error message, instead of a string. Also, previously, we relied on exception handling to know when a package is not present. But there are cases where no exception is raised, but the package output has an 'ERROR' string. This commit changes from `execpipe` to `execute`, which will raise an exception with the output of the `pkginfo` command. It also explicitly looks for an 'ERROR' string in the package output. This commit also refactors the duplicate namemap so that it is defined only once, and removes the nil entries so that only keys of interest are retained. It also adds fixtures and spec tests for the provider.