Does a true command ship by default on Win32?

If not this will break the tests there. Unittests should be runnable -
please confirm you have a windows box in your CI pipeline by default
and the tests all pass on that platform with this change.

Paul

On Tuesday, November 23, 2010, Paul Berry <p...@puppetlabs.com> wrote:
> The tests for the upstart provider were attempting to stub
> Process::Status.exitstatus.  However, this doesn't work (presumably
> because Process::Status is implemented in C).  As a result, the
> upstart spec tests were failing if the most recent exit code was
> nonzero.  Changed the tests so that instead of stubbing
> Process::Status.exitstatus to return zero, they execute a command that
> is known to succeed (`true`).
>
> Paired-with: Jesse Wolfe <je...@puppetlabs.com>
> Signed-off-by: Paul Berry <p...@puppetlabs.com>
> ---
> Local-branch: maint/next/make_upstart_tests_more_robust
>  spec/unit/provider/service/upstart.rb |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/spec/unit/provider/service/upstart.rb 
> b/spec/unit/provider/service/upstart.rb
> index 439fd2c..9fde9e6 100644
> --- a/spec/unit/provider/service/upstart.rb
> +++ b/spec/unit/provider/service/upstart.rb
> @@ -24,8 +24,7 @@ describe provider_class do
>        resource = Puppet::Type.type(:service).new(:name => "foo", :provider 
> => :upstart, :status => "/bin/foo")
>        provider = provider_class.new(resource)
>
> -      Process::Status.any_instance.stubs(:exitstatus).returns(0)
> -      provider.expects(:ucommand)
> +      provider.expects(:ucommand).with { `true`; true }
>        provider.status.should == :running
>      end
>
> --
> 1.7.2
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To post to this group, send email to puppet-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-dev+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to