Sha256: d8409628b0b059a85d20ed312d6983c3c0d3c553510c5a34a1bd4b3c093b1ac4

Contents?: true

Size: 705 Bytes

Versions: 2

Compression:

Stored size: 705 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'spec_helper'

describe TTY::Terminal::SystemPager, '#simple' do
  let(:input)    { StringIO.new }
  let(:output)   { StringIO.new }
  let(:shell)    { TTY::Shell.new(input, output) }
  let(:terminal) { TTY.terminal }
  let(:object)   { described_class }

  subject { object.new(text) }

  before {
    TTY.stub(:shell).and_return(shell)
    IO.stub(:pipe).and_return([input, output])
    Kernel.stub(:fork) { true }
  }

  context 'when text fits on screen' do
    let(:text) { "a\na\na\na\na\na\na\na\na\na\n" }

    it "doesn't page text not long enough" do
      Kernel.should_receive(:exec)
      Kernel.should_receive(:select)
      subject.page
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tty-0.0.11 spec/tty/terminal/pager/system/page_spec.rb
tty-0.0.10 spec/tty/terminal/pager/system/page_spec.rb