File: test_rake_file_list_path_map.rb

package info (click to toggle)
rake 13.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 928 kB
  • sloc: ruby: 9,635; sh: 19; ansic: 19; makefile: 11
file content (15 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true
require File.expand_path("../helper", __FILE__)

class TestRakeFileListPathMap < Rake::TestCase # :nodoc:
  def test_file_list_supports_pathmap
    assert_equal ["a", "b"], FileList["dir/a.rb", "dir/b.rb"].pathmap("%n")
  end

  def test_file_list_supports_pathmap_with_a_block
    mapped = FileList["dir/a.rb", "dir/b.rb"].pathmap("%{.*,*}n") do |name|
      name.upcase
    end
    assert_equal ["A", "B"], mapped
  end
end