1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
10 require "interaction/undo_manager"
12 class TestUndoManager < Test::Unit::TestCase
14 @manager = UndoManager.new([:a, :b, :c])
15 @manager.metaclass_eval do
23 assert_nil @manager.find_common
27 @manager.undo(:a, 2, :allow_more => true)
29 assert_equal 3, @manager.find_common
33 @manager.undo(:a, 3, :allow_more => true)
34 @manager.undo(:b, nil)
35 assert_equal nil, @manager.find_common
39 @manager.undo(:a, 1, :allow_more => true)
42 assert_equal nil, @manager.find_common
47 @manager.undo(:b, 1, :allow_more => true)
48 assert_equal 3, @manager.find_common