summaryrefslogtreecommitdiff
path: root/jni/ruby/test/rake/test_rake_pathname_extensions.rb
blob: 7da702d0c748e7e81f7f33291c378bfd7bb63bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require File.expand_path('../helper', __FILE__)
require 'rake/ext/pathname'

class TestRakePathnameExtensions < Rake::TestCase
  def test_ext_works_on_pathnames
    pathname = Pathname.new("abc.foo")
    assert_equal Pathname.new("abc.bar"), pathname.ext("bar")
  end

  def test_path_map_works_on_pathnames
    pathname = Pathname.new("this/is/a/dir/abc.rb")
    assert_equal Pathname.new("abc.rb"), pathname.pathmap("%f")
    assert_equal Pathname.new("this/is/a/dir"), pathname.pathmap("%d")
  end
end