test/dummy_buffer.rb (514B) - raw
1 require "sup"
2
3 module Redwood
4
5 class DummyBuffer
6 attr_reader :width, :height, :dirty_count, :commit_count
7
8 def initialize width=80, height=25
9 @width = width
10 @height = height
11 @dirty = false
12 @dirty_count = 0
13 @commit_count = 0
14 end
15
16 def content_height; @height - 1; end
17 def content_width; @width; end
18
19 def mark_dirty
20 @dirty = true
21 @dirty_count += 1
22 end
23
24 def dirty?; @dirty; end
25
26 def commit
27 @dirty = false
28 @commit_count += 1
29 end
30
31 def write(*args); end
32 end
33
34 end