# encoding: utf-8 require 'spec_helper' require 'fedux_org_stdlib/command_finder' RSpec.describe FeduxOrgStdlib::CommandFinder do context '#path' do it 'finds command in given order' do touch_file 'command.sh' filesystem_permissions '0755', 'command.sh' editor = CommandFinder.new alternatives: %w(command.sh), search_paths: absolute_path('.') expect(editor.path).to eq absolute_path('command.sh') end it 'returns nil if no command can be found' do editor = CommandFinder.new alternatives: %w(command.sh), search_paths: absolute_path('.') expect(editor.path).to be nil end end end