Sha256: 644a7f78617c270008a831d462ae734156a36f1b31ff44426b3164ca8df0491c

Contents?: true

Size: 509 Bytes

Versions: 3

Compression:

Stored size: 509 Bytes

Contents

# coding: utf-8

RSpec.describe TTY::Pager::SystemPager, '#command_exists?' do
  subject(:pager) { described_class }

  it "successfully checks command exists on the system" do
    allow(TTY::Which).to receive(:which).with('less').and_return('/usr/bin/less')
    expect(pager.command_exists?('less')).to eq(true)
  end

  it "fails to check command exists on the system" do
    allow(TTY::Which).to receive(:which).with('less').and_return(nil)
    expect(pager.command_exists?('less')).to eq(false)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tty-pager-0.4.0 spec/unit/system/command_exists_spec.rb
tty-pager-0.3.0 spec/unit/system/command_exists_spec.rb
tty-pager-0.2.0 spec/unit/system/command_exists_spec.rb