Sha256: 9624a2f149803f3e3752ef7d13d169ca1b6d4aeed4c366bddb4555c0ac76710d

Contents?: true

Size: 593 Bytes

Versions: 2

Compression:

Stored size: 593 Bytes

Contents

RSpec.describe TTY::Pager::NullPager, '.page' do
  let(:output)   { StringIO.new }

  it "prints content to stdout when tty device" do
    allow(output).to receive(:tty?).and_return(true)
    pager = described_class.new(output: output)
    text = "I try all things, I achieve what I can.\n"

    pager.page(text)

    expect(output.string).to eq(text)
  end

  it "returns text when non-tty device" do
    pager = described_class.new(output: output)
    text = "I try all things, I achieve what I can.\n"

    expect(pager.page(text)).to eq(text)
    expect(output.string).to eq('')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tty-pager-0.11.0 spec/unit/null/page_spec.rb
tty-pager-0.10.0 spec/unit/null/page_spec.rb