Permalink
Browse files

Suggest terminal size of 30x8

  • Loading branch information...
1 parent 5151e03 commit c3499c49e5133ef7b8097bc97a24894485fb415d @justincampbell committed Aug 11, 2012
Showing with 12 additions and 2 deletions.
  1. +7 −0 lib/screen.rb
  2. +3 −0 lib/tp/presenter.rb
  3. +2 −2 spec/lib/tp/presenter_spec.rb
View
@@ -9,6 +9,13 @@ def height
`tput lines`.to_i
end
+ def suggest(x, y)
+ y.times do |n|
+ print "\n" if n.nonzero?
+ print "\u2588" * x
+ end
+ end
+
def width
`tput cols`.to_i
end
View
@@ -7,6 +7,9 @@ def initialize(markdown)
end
def present
+ Screen.suggest 30, 8
+ Keyboard.wait_for_enter
+
slides.each do |slide|
Screen.clear!
show_slide slide
@@ -19,12 +19,12 @@
}
before :each do
- Screen.stub width: 20, height: 20
+ Screen.stub width: 20, height: 20, suggest: nil
end
describe "#present" do
it "works" do
- Keyboard.should_receive(:wait_for_enter).exactly(3).times
+ Keyboard.should_receive(:wait_for_enter).exactly(4).times
Screen.should_receive(:clear!).exactly(4).times
presenter.should_receive(:print).exactly(3).times

0 comments on commit c3499c4

Please sign in to comment.