Commit f2064f04 authored by Tim Smith's avatar Tim Smith
Browse files

Exclude the specs on modern chef + fix a bad spec



This spec actually ran the code and it would fail if you had node
installed.
Signed-off-by: default avatarTim Smith <tsmith@chef.io>
parent 9bae9132
require 'rspec'
require 'chefspec'
require 'chef/sugar'
require 'chef/version'
require_relative 'support/shared_examples'
......@@ -22,4 +23,6 @@ RSpec.configure do |config|
# ChefSpec configuration
config.log_level = :fatal
config.filter_run_excluding pre_chef16_only: true if Gem::Requirement.new(">= 16.0.257").satisfied_by?(Gem::Version.new(Chef::VERSION))
end
require 'spec_helper'
describe Chef::Sugar::Shell do
describe '#which' do
describe '#which', :pre_chef16_only do
it 'returns the first executable matching the command' do
allow(File).to receive(:executable?).and_return(false)
allow(File).to receive(:executable?).with('/usr/bin/mongo').and_return(true)
......@@ -46,7 +46,7 @@ describe Chef::Sugar::Shell do
end
it 'returns false if the given binary does not exist' do
allow(File).to receive(:executable?).and_return(false)
allow(described_class).to receive(:which).with('node').and_return(nil)
expect(described_class.installed?('node')).to be false
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment