test/test_fs.rb in rvc-1.6.0 vs test/test_fs.rb in rvc-1.7.0

- old
+ new

@@ -1,7 +1,6 @@ -require 'test/unit' -require 'rvc' +require 'test_helper' require 'inventory_fixtures' class FSTest < Test::Unit::TestCase NodeDaa = FixtureNode.new 'Daa' NodeDab = FixtureNode.new 'Dab' @@ -16,24 +15,23 @@ 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 + @shell = RVC::Shell.new + @shell.instance_variable_set :@fs, @context end def teardown @context = nil - $shell = nil + @shell = nil end def test_new assert_equal Root, @context.cur assert_equal "", @context.display_path - assert_equal 0, $shell.session.marks.size + assert_equal 0, @shell.fs.marks.size assert_equal [['', Root]], @context.cur.rvc_path end def test_lookup_simple assert_equal [], @context.lookup('nonexistent') @@ -95,23 +93,23 @@ obj = @context.lookup('~foo')[0] assert_equal nil, obj ['foo', '~', '7', ''].each do |mark| - $shell.session.set_mark mark, [b_obj] + @shell.fs.marks[mark] = [b_obj] obj = @context.lookup("~#{mark}")[0] assert_equal [['', Root], ['a', NodeA], ['b', NodeB]], obj.rvc_path - $shell.session.set_mark mark, [] + @shell.fs.marks[mark] = [] obj = @context.lookup("~#{mark}")[0] assert_equal nil, obj end - $shell.session.set_mark '7', [b_obj] + @shell.fs.marks['7'] = [b_obj] obj = @context.lookup("7")[0] assert_equal [['', Root], ['a', NodeA], ['b', NodeB]], obj.rvc_path - $shell.session.set_mark '7', [] + @shell.fs.marks['7'] = [] obj = @context.lookup("7")[0] assert_equal nil, obj end def test_cd