From 774bafe7bbce565ecabd2a6e3e329ed95727a398 Mon Sep 17 00:00:00 2001 From: juniorsysadmin Date: Thu, 30 Jul 2015 20:15:44 +1000 Subject: [PATCH] Fix failing provider RSpec test when running on docker This hack mocks an exit success so that the test does not fail when run on docker. --- .travis.yml | 2 +- spec/unit/puppet/provider/package/npm_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cd7ffde6..87523ab7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ --- -sudo: true +sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'" diff --git a/spec/unit/puppet/provider/package/npm_spec.rb b/spec/unit/puppet/provider/package/npm_spec.rb index 430ebed1..00b4dec4 100644 --- a/spec/unit/puppet/provider/package/npm_spec.rb +++ b/spec/unit/puppet/provider/package/npm_spec.rb @@ -60,6 +60,7 @@ def self.it_should_respond_to(*actions) it "should log and return no packages if JSON isn't output" do @provider.class.expects(:execute).with(['/usr/local/bin/npm', 'list', '--json', '--global'], anything).returns("failure!") + Process::Status.any_instance.expects(:success?).returns(true) Puppet.expects(:debug).with(regexp_matches(/npm list.*failure!/)) expect(@provider.class.instances).to eq([]) end