test/test_fs.rb in rvc-1.5.0 vs test/test_fs.rb in rvc-1.6.0
- old
+ new
@@ -16,20 +16,24 @@
Root.rvc_link nil, ''
def setup
@context = RVC::FS.new Root
+ session = RVC::MemorySession.new
+ $shell = RVC::Shell.new session
+ $shell.instance_variable_set :@fs, @context
end
def teardown
@context = nil
+ $shell = nil
end
def test_new
assert_equal Root, @context.cur
assert_equal "", @context.display_path
- assert_equal 0, @context.marks.size
+ assert_equal 0, $shell.session.marks.size
assert_equal [['', Root]], @context.cur.rvc_path
end
def test_lookup_simple
assert_equal [], @context.lookup('nonexistent')
@@ -91,23 +95,23 @@
obj = @context.lookup('~foo')[0]
assert_equal nil, obj
['foo', '~', '7', ''].each do |mark|
- @context.mark mark, [b_obj]
+ $shell.session.set_mark mark, [b_obj]
obj = @context.lookup("~#{mark}")[0]
assert_equal [['', Root], ['a', NodeA], ['b', NodeB]], obj.rvc_path
- @context.mark mark, []
+ $shell.session.set_mark mark, []
obj = @context.lookup("~#{mark}")[0]
assert_equal nil, obj
end
- @context.mark '7', [b_obj]
+ $shell.session.set_mark '7', [b_obj]
obj = @context.lookup("7")[0]
assert_equal [['', Root], ['a', NodeA], ['b', NodeB]], obj.rvc_path
- @context.mark '7', []
+ $shell.session.set_mark '7', []
obj = @context.lookup("7")[0]
assert_equal nil, obj
end
def test_cd