# $Id: tc_dir.rb,v 1.2 2002/04/08 14:05:08 knu Exp $

require 'test/unit'
begin
  require 'features/ruby18/dir'
rescue LoadError; end

class TC_Dir < Test::Unit::TestCase
  def test_s_chdir
    # test 1
    assert_equal(1, Dir::chdir(".") { 1 })

    # test 2
    pwd = Dir::pwd
    dir = nil
    Dir::chdir("/") { dir = Dir::pwd }
    assert_equal(pwd, Dir::pwd)
    assert_equal("/", dir)
  end
end
