Sha256: 88119b1cf55a6cb4af2d01a811c0bd36bff032252f5c84ff70f2495346749ed6
Contents?: true
Size: 779 Bytes
Versions: 1
Compression:
Stored size: 779 Bytes
Contents
RSpec.describe TTY::Pager::SystemPager, '.page' do it "executes the pager command in a subprocess" do text = "I try all things, I achieve what I can.\n" allow(TTY::Pager::SystemPager).to receive(:exec_available?).and_return(true) output = double(:output, :tty? => true) pager = described_class.new(output: output) write_io = spy pid = 12345 allow(pager).to receive(:open).and_return(write_io) allow(write_io).to receive(:pid).and_return(pid) status = double(:status, :success? => true) allow(Process).to receive(:waitpid2).with(pid, any_args).and_return([1, status]) expect(pager.page(text)).to eq(true) expect(write_io).to have_received(:write).with(text) expect(write_io).to have_received(:close) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tty-pager-0.11.0 | spec/unit/system/page_spec.rb |