diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-06 09:31:37 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-06 09:31:37 +0000 |
commit | f6d2b4858891376dec83e43dccfa028d4b32b184 (patch) | |
tree | 053f00bd120e730616a371793eb579edddba29e4 /test/rake/test_rake_file_list.rb | |
parent | 6057695c87cf8281f3ff9aa37cfdf1c317e1f9c1 (diff) | |
download | ruby-f6d2b4858891376dec83e43dccfa028d4b32b184.tar.gz |
* lib/rake.rb, lib/rake/*, test/rake/*: Update latest rake master(e47d023)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_file_list.rb')
-rw-r--r-- | test/rake/test_rake_file_list.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/rake/test_rake_file_list.rb b/test/rake/test_rake_file_list.rb index 899f3bc509..c1b4c92086 100644 --- a/test/rake/test_rake_file_list.rb +++ b/test/rake/test_rake_file_list.rb @@ -1,4 +1,5 @@ require File.expand_path('../helper', __FILE__) +require 'pathname' class TestRakeFileList < Rake::TestCase FileList = Rake::FileList @@ -46,6 +47,12 @@ class TestRakeFileList < Rake::TestCase fl.sort end + def test_create_with_pathname + fl = FileList.new(Pathname.new("*.c")) + assert_equal ["abc.c", "x.c", "xyz.c"].sort, + fl.sort + end + def test_create_with_block fl = FileList.new { |f| f.include("x") } assert_equal ["x"], fl.resolve @@ -74,12 +81,24 @@ class TestRakeFileList < Rake::TestCase fl.sort end + def test_include_with_pathname + fl = FileList.new.include(Pathname.new("*.c")) + assert_equal ["abc.c", "x.c", "xyz.c"].sort, + fl.sort + end + def test_append fl = FileList.new fl << "a.rb" << "b.rb" assert_equal ['a.rb', 'b.rb'], fl end + def test_append_pathname + fl = FileList.new + fl << Pathname.new("a.rb") + assert_equal ['a.rb'], fl + end + def test_add_many fl = FileList.new fl.include %w(a d c) @@ -163,6 +182,15 @@ class TestRakeFileList < Rake::TestCase assert_equal [], fl end + def test_exclude_pathname + fl = FileList['x.c', 'abc.c', 'other'] + fl.each { |fn| touch fn, :verbose => false } + + fl.exclude(Pathname.new('*.c')) + + assert_equal ['other'], fl + end + def test_excluding_via_block fl = FileList['a.c', 'b.c', 'xyz.c'] fl.exclude { |fn| fn.pathmap('%n') == 'xyz' } |