Sha256: 86ba5654f0d5f3d628c0186afcd71778283608d78d61e97383a66c50b9370379

Contents?: true

Size: 640 Bytes

Versions: 27

Compression:

Stored size: 640 Bytes

Contents

# 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

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.11.18 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.17 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.16 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.15 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.14 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.12 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.11 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.9 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.8 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.7 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.6 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.5 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.4 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.3 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.2 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.1 spec/command_finder_spec.rb
fedux_org-stdlib-0.11.0 spec/command_finder_spec.rb
fedux_org-stdlib-0.10.9 spec/command_finder_spec.rb
fedux_org-stdlib-0.10.8 spec/command_finder_spec.rb
fedux_org-stdlib-0.10.7 spec/command_finder_spec.rb