Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'test/unit'
require 'fox16'
require 'fox16/undolist'
include Fox
class DummyCommand < FXCommand
def undo ; end
def redo ; end
def undoName
"My Undo Name"
end
def redoName
"My Redo Name"
end
end
class TC_FXUndoList < Test::Unit::TestCase
def test_cut_with_nil_marker
undoList = FXUndoList.new
assert_nothing_raised {
undoList.cut
}
end
def test_undoName
undoList = FXUndoList.new
assert_nil(undoList.undoName)
c = DummyCommand.new
undoList.add(c)
assert_equal(c.undoName, undoList.undoName)
end
def test_redoName
undoList = FXUndoList.new
assert_nil(undoList.redoName)
c = DummyCommand.new
undoList.add(c)
undoList.undo
assert_equal(c.redoName, undoList.redoName)
end
end