Sha256: 25840717cd01a59142a9334e9d5cf7bfcbd520b5100fec19bcb82194205daa1e

Contents?: true

Size: 513 Bytes

Versions: 2

Compression:

Stored size: 513 Bytes

Contents

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(:exist?).with('less').and_return('/usr/bin/less').and_return(true)
    expect(pager.command_exists?('less')).to eq(true)
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tty-pager-0.11.0 spec/unit/system/command_exists_spec.rb
tty-pager-0.10.0 spec/unit/system/command_exists_spec.rb