Sha256: c98a229ee0fb18f835d7df1508653e4e7d6062f09a780ada0bda7cf8d3f9fa73

Contents?: true

Size: 896 Bytes

Versions: 10

Compression:

Stored size: 896 Bytes

Contents

########################################################################
# test_misc.rb
#
# Test suite for miscellaneous items that didn't warrant their own
# test file.
########################################################################
require 'pathname2'
require 'test-unit'

class MyPathname < Pathname; end

class TC_Pathname_Misc < Test::Unit::TestCase
  def setup
    @mypath = MyPathname.new(Dir.pwd)
  end

  test "subclasses return instances of that subclass" do
    assert_kind_of(MyPathname, @mypath)
    assert_kind_of(MyPathname, @mypath + MyPathname.new('foo'))
    assert_kind_of(MyPathname, @mypath.realpath)
  end

  test "custom pn method works as expected" do
    assert_respond_to(Kernel, :pn)
    assert_nothing_raised{ pn{'c:\foo'} }
    assert_kind_of(Pathname, pn{'c:\foo'})
    assert_equal('c:\foo', pn{'c:\foo'})
  end

  def teardown
    @mypath = nil
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pathname2-1.8.4 test/windows/test_misc.rb
pathname2-1.8.3 test/windows/test_misc.rb
pathname2-1.8.2 test/windows/test_misc.rb
pathname2-1.8.1 test/windows/test_misc.rb
pathname2-1.8.0 test/windows/test_misc.rb
pathname2-1.7.4 test/windows/test_misc.rb
pathname2-1.7.3 test/windows/test_misc.rb
pathname2-1.7.2 test/windows/test_misc.rb
pathname2-1.7.1 test/windows/test_misc.rb
pathname2-1.7.0 test/windows/test_misc.rb