spec/unit/page_spec.rb in tty-pager-0.7.1 vs spec/unit/page_spec.rb in tty-pager-0.8.0
- old
+ new
@@ -14,11 +14,12 @@
expect(TTY::Pager::NullPager).to have_received(:new)
end
it "selects basic pager on non tty systems" do
basic_pager = spy(:basic_pager)
- allow(TTY::Pager::SystemPager).to receive(:available?) { false }
+ allow(described_class).to receive(:jruby?) { false }
+ allow(TTY::Pager::SystemPager).to receive(:can?) { false }
allow(TTY::Pager::BasicPager).to receive(:new) { basic_pager }
pager = described_class.new
text = "I try all things, I achieve what I can.\n"
pager.page(text)
@@ -26,11 +27,11 @@
expect(basic_pager).to have_received(:page).with(text)
end
it "selects system pager on systems with tty" do
system_pager = spy(:system_pager)
- allow(TTY::Pager::SystemPager).to receive(:available?) { true }
allow(described_class).to receive(:jruby?) { false }
+ allow(TTY::Pager::SystemPager).to receive(:can?) { true }
allow(TTY::Pager::SystemPager).to receive(:new) { system_pager }
pager = described_class.new
text = "I try all things, I achieve what I can.\n"
pager.page(text)