File: test_rake_pathname_extensions.rb

package info (click to toggle)
rake 10.5.0-2%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,104 kB
  • sloc: ruby: 9,324; ansic: 19; sh: 15; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 505 bytes parent folder | download
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