win32-api 1.5.3-universal-mingw32 → 1.6.0-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +174 -169
- data/Gemfile +4 -0
- data/Gemfile.lock +24 -0
- data/README +129 -131
- data/Rakefile +185 -182
- data/appveyor.yml +42 -0
- data/ext/win32/api.c +1092 -1092
- data/lib/win32/api.rb +14 -8
- data/lib/win32/ruby21_32/win32/api.so +0 -0
- data/lib/win32/ruby21_64/win32/api.so +0 -0
- data/lib/win32/ruby22_32/win32/api.so +0 -0
- data/lib/win32/ruby22_64/win32/api.so +0 -0
- data/lib/win32/ruby23_32/win32/api.so +0 -0
- data/lib/win32/ruby23_64/win32/api.so +0 -0
- data/lib/win32/ruby2_32/win32/api.so +0 -0
- data/lib/win32/ruby2_64/win32/api.so +0 -0
- data/test/test_win32_api.rb +145 -145
- data/vendor/bundle/ruby/2.2.0/bin/devkit +23 -0
- data/vendor/bundle/ruby/2.2.0/bin/devkit.bat +6 -0
- data/vendor/bundle/ruby/2.2.0/bin/rake +23 -0
- data/vendor/bundle/ruby/2.2.0/bin/rake.bat +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/CHANGELOG +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/LICENSE +339 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/README.md +73 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/Rakefile +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/colorize.gemspec +35 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize/class_methods.rb +116 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize/instance_methods.rb +135 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/test/test_colorize.rb +161 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Gemfile +4 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/README.md +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Rakefile +1 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Rspec-example-matchers.txt +184 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/bin/devkit +87 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/devkit.gemspec +27 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/core.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/identity.rb +78 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/ssh_identity.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/version.rb +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/core_spec.rb +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/identity_spec.rb +1 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/ssh_identity_spec.rb +1 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit_spec.rb +5 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/spec_helper.rb +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/AUTHORS +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/COPYING +339 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Changelog.md +415 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Gemfile +9 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/INSTALL +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/LICENSE +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/README.rdoc +74 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Rakefile +30 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/TODO +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/ansi_colors.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/asking_for_arrays.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/basic_usage.rb +75 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/color_scheme.rb +32 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/get_character.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/limit.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/menus.rb +65 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/overwrite.rb +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/page_and_wrap.rb +322 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/password.rb +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/repeat_entry.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/trapping_eof.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/using_readline.rb +17 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/highline.gemspec +37 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline.rb +1048 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/color_scheme.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/compatibility.rb +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/import.rb +41 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/menu.rb +381 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/question.rb +480 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/simulate.rb +48 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/style.rb +192 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/version.rb +4 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/setup.rb +1360 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/site/highline.css +65 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/site/images/logo.png +0 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/site/index.html +58 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/string_methods.rb +32 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_color_scheme.rb +96 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_highline.rb +1402 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_import.rb +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_menu.rb +439 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_simulator.rb +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_string_highline.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_style.rb +578 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/BSDL +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/COPYING +57 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/Gemfile +9 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/LEGAL +4 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/README.rdoc +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/Rakefile +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/benchmarks/bm_yhpg.rb +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/benchmarks/helper.rb +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert.rb +338 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert/enable_tracepoint_events.rb +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert/version.rb +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/power_assert.gemspec +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/test/helper.rb +10 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/test/test_power_assert.rb +512 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/CONTRIBUTING.rdoc +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/History.rdoc +719 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/Manifest.txt +154 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/README.rdoc +157 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/Rakefile +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/bin/rake +33 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/glossary.rdoc +42 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rake.1 +141 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rakefile.rdoc +624 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.6.rdoc +37 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.4.rdoc +60 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.5.rdoc +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.6.rdoc +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.1.rdoc +58 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.2.rdoc +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake.rb +73 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb +787 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/backtrace.rb +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/clean.rb +76 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/cloneable.rb +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/ftptools.rb +137 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/sshpublisher.rb +60 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/cpu_counter.rb +120 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/default_loader.rb +14 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/dsl_definition.rb +194 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/early_time.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_list.rb +436 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_task.rb +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_utils.rb +123 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/invocation_chain.rb +56 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/late_time.rb +17 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/linked_list.rb +111 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/loaders/makefile.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/multi_task.rb +13 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/name_space.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/packagetask.rb +199 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/phony.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/private_reader.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/promise.rb +99 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/pseudo_status.rb +29 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/scope.rb +42 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task.rb +391 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_arguments.rb +102 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_manager.rb +316 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/tasklib.rb +11 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/testtask.rb +204 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/thread_history_display.rb +48 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/thread_pool.rb +163 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/trace_output.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/version.rb +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/win32.rb +50 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/rakelib/test_times.rake +25 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/file_creation.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/helper.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/support/rakefile_definitions.rb +476 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/support/ruby_runner.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_private_reader.rb +42 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake.rb +40 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_application.rb +659 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_application_options.rb +468 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_backtrace.rb +119 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_clean.rb +61 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_cpu_counter.rb +68 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_definitions.rb +84 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_directory_task.rb +76 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_dsl.rb +40 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_early_time.rb +31 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_list.rb +687 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_list_path_map.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_task.rb +197 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_utils.rb +318 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_ftp_file.rb +74 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_functional.rb +484 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_invocation_chain.rb +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_late_time.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_linked_list.rb +84 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_makefile_loader.rb +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_multi_task.rb +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_name_space.rb +57 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_package_task.rb +79 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map.rb +168 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_rake_test_loader.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_reduce_compat.rb +26 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_require.rb +40 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_rules.rb +388 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_scope.rb +44 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task.rb +430 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_argument_parsing.rb +119 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_arguments.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_manager.rb +178 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_with_arguments.rb +172 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_test_task.rb +130 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_thread_pool.rb +145 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_top_level_functions.rb +71 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_win32.rb +72 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_thread_history_display.rb +101 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_trace_output.rb +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/COPYING +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/GPL +339 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/LGPL +502 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/PSFL +271 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/README.md +101 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/Rakefile +71 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test-unit.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit.rb +505 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/assertion-failed-error.rb +25 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/assertions.rb +2218 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/attribute-matcher.rb +26 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/attribute.rb +158 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/auto-runner-loader.rb +17 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/autorunner.rb +536 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/code-snippet-fetcher.rb +58 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector.rb +73 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/descendant.rb +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/dir.rb +108 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/load.rb +202 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/objectspace.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/xml.rb +249 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/color-scheme.rb +198 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/color.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/data.rb +262 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/diff.rb +746 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/error.rb +158 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/exception-handler.rb +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/failure.rb +169 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/fault-location-detector.rb +100 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/fixture.rb +295 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/notification.rb +136 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/omission.rb +195 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/pending.rb +154 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/priority.rb +192 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/console.rb +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/emacs.rb +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/xml.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/test-suite-creator.rb +89 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testcase.rb +811 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testresult.rb +132 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testsuite.rb +175 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/console/outputlevel.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/console/testrunner.rb +693 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunner.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunnermediator.rb +114 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/xml/testrunner.rb +224 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/backtracefilter.rb +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/method-owner-finder.rb +28 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/observable.rb +90 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/output.rb +31 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/procwrapper.rb +48 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/version.rb +5 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/adder.rb +13 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/subtracter.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_adder.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_subtracter.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_user.rb +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test-descendant.rb +178 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test-load.rb +442 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test_dir.rb +406 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test_objectspace.rb +100 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header-label.csv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header-label.tsv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header.csv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header.tsv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/no-header.csv +2 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/no-header.tsv +2 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/plus.csv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/run-test.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-assertions.rb +2160 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-attribute-matcher.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-attribute.rb +123 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-code-snippet.rb +37 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-color-scheme.rb +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-color.rb +47 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-data.rb +303 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-diff.rb +518 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-emacs-runner.rb +60 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-error.rb +26 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-failure.rb +33 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-fault-location-detector.rb +163 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-fixture.rb +713 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-notification.rb +33 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-omission.rb +81 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-pending.rb +70 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-priority.rb +173 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-case.rb +1171 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-result.rb +113 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-suite-creator.rb +97 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-suite.rb +150 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/testunit-test-util.rb +31 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/ui/test_testrunmediator.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test-method-owner-finder.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test-output.rb +11 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_backtracefilter.rb +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_observable.rb +102 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_procwrapper.rb +36 -0
- data/vendor/bundle/ruby/2.2.0/specifications/colorize-0.7.7.gemspec +38 -0
- data/vendor/bundle/ruby/2.2.0/specifications/devkit-0.1.0.gemspec +46 -0
- data/vendor/bundle/ruby/2.2.0/specifications/highline-1.7.8.gemspec +37 -0
- data/vendor/bundle/ruby/2.2.0/specifications/power_assert-0.3.0.gemspec +41 -0
- data/vendor/bundle/ruby/2.2.0/specifications/rake-11.1.2.gemspec +43 -0
- data/vendor/bundle/ruby/2.2.0/specifications/test-unit-3.1.9.gemspec +47 -0
- data/win32-api.gemspec +27 -27
- metadata +345 -5
- data/lib/win32/ruby18/win32/api.so +0 -0
- data/lib/win32/ruby19/win32/api.so +0 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
|
3
|
+
class TestRakeEarlyTime < Rake::TestCase
|
4
|
+
def test_create
|
5
|
+
early = Rake::EarlyTime.instance
|
6
|
+
assert early <= Time.now
|
7
|
+
assert early < Time.now
|
8
|
+
assert early != Time.now
|
9
|
+
assert Time.now > early
|
10
|
+
assert Time.now >= early
|
11
|
+
assert Time.now != early
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_equality
|
15
|
+
early = Rake::EarlyTime.instance
|
16
|
+
assert_equal early, early, "two early times should be equal"
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_original_time_compare_is_not_messed_up
|
20
|
+
t1 = Time.mktime(1970, 1, 1, 0, 0, 0)
|
21
|
+
t2 = Time.now
|
22
|
+
assert t1 < t2
|
23
|
+
assert t2 > t1
|
24
|
+
assert t1 == t1
|
25
|
+
assert t2 == t2
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_to_s
|
29
|
+
assert_equal "<EARLY TIME>", Rake::EARLY.to_s
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
######################################################################
|
5
|
+
class TestRakeFileCreationTask < Rake::TestCase
|
6
|
+
include Rake
|
7
|
+
include Rake::DSL
|
8
|
+
|
9
|
+
DUMMY_DIR = 'dummy_dir'
|
10
|
+
|
11
|
+
def setup
|
12
|
+
super
|
13
|
+
|
14
|
+
Task.clear
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_file_needed
|
18
|
+
create_dir DUMMY_DIR
|
19
|
+
fc_task = Task[DUMMY_DIR]
|
20
|
+
assert_equal DUMMY_DIR, fc_task.name
|
21
|
+
FileUtils.rm_rf fc_task.name
|
22
|
+
assert fc_task.needed?, "file should be needed"
|
23
|
+
FileUtils.mkdir fc_task.name
|
24
|
+
assert_equal nil, fc_task.prerequisites.map { |n| Task[n].timestamp }.max
|
25
|
+
assert ! fc_task.needed?, "file should not be needed"
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_directory
|
29
|
+
directory DUMMY_DIR
|
30
|
+
fc_task = Task[DUMMY_DIR]
|
31
|
+
assert_equal DUMMY_DIR, fc_task.name
|
32
|
+
assert FileCreationTask === fc_task
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_no_retriggers_on_filecreate_task
|
36
|
+
create_timed_files(OLDFILE, NEWFILE)
|
37
|
+
t1 = Rake.application.intern(FileCreationTask, OLDFILE).enhance([NEWFILE])
|
38
|
+
t2 = Rake.application.intern(FileCreationTask, NEWFILE)
|
39
|
+
assert ! t2.needed?, "Should not need to build new file"
|
40
|
+
assert ! t1.needed?, "Should not need to rebuild old file because of new"
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_no_retriggers_on_file_task
|
44
|
+
create_timed_files(OLDFILE, NEWFILE)
|
45
|
+
t1 = Rake.application.intern(FileCreationTask, OLDFILE).enhance([NEWFILE])
|
46
|
+
t2 = Rake.application.intern(FileCreationTask, NEWFILE)
|
47
|
+
assert ! t2.needed?, "Should not need to build new file"
|
48
|
+
assert ! t1.needed?, "Should not need to rebuild old file because of new"
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_very_early_timestamp
|
52
|
+
t1 = Rake.application.intern(FileCreationTask, OLDFILE)
|
53
|
+
assert t1.timestamp < Time.now
|
54
|
+
assert t1.timestamp < Time.now - 1_000_000
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,687 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
class TestRakeFileList < Rake::TestCase
|
5
|
+
FileList = Rake::FileList
|
6
|
+
|
7
|
+
def setup
|
8
|
+
super
|
9
|
+
|
10
|
+
FileUtils.mkdir "CVS" rescue nil
|
11
|
+
FileUtils.mkdir ".svn" rescue nil
|
12
|
+
@cdir = "cfiles"
|
13
|
+
FileUtils.mkdir @cdir rescue nil
|
14
|
+
FileUtils.touch ".dummy"
|
15
|
+
FileUtils.touch "x.bak"
|
16
|
+
FileUtils.touch "x~"
|
17
|
+
FileUtils.touch "core"
|
18
|
+
FileUtils.touch "x.c"
|
19
|
+
FileUtils.touch "xyz.c"
|
20
|
+
FileUtils.touch "abc.c"
|
21
|
+
FileUtils.touch "abc.h"
|
22
|
+
FileUtils.touch "abc.x"
|
23
|
+
FileUtils.touch "existing"
|
24
|
+
|
25
|
+
open 'xyzzy.txt', 'w' do |io|
|
26
|
+
io.puts 'x'
|
27
|
+
io.puts 'XYZZY'
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_delegating_methods_do_not_include_to_a_or_to_ary
|
33
|
+
assert ! FileList::DELEGATING_METHODS.include?("to_a"), "should not include to_a"
|
34
|
+
assert ! FileList::DELEGATING_METHODS.include?(:to_a), "should not include to_a"
|
35
|
+
assert ! FileList::DELEGATING_METHODS.include?("to_ary"), "should not include to_ary"
|
36
|
+
assert ! FileList::DELEGATING_METHODS.include?(:to_ary), "should not include to_ary"
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_create
|
40
|
+
fl = FileList.new
|
41
|
+
assert_equal 0, fl.size
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_create_with_args
|
45
|
+
fl = FileList.new("*.c", "x")
|
46
|
+
assert_equal ["abc.c", "x.c", "xyz.c", "x"].sort,
|
47
|
+
fl.sort
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_create_with_pathname
|
51
|
+
fl = FileList.new(Pathname.new("*.c"))
|
52
|
+
assert_equal ["abc.c", "x.c", "xyz.c"].sort,
|
53
|
+
fl.sort
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_create_with_block
|
57
|
+
fl = FileList.new { |f| f.include("x") }
|
58
|
+
assert_equal ["x"], fl.resolve
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_create_with_brackets
|
62
|
+
fl = FileList["*.c", "x"]
|
63
|
+
assert_equal ["abc.c", "x.c", "xyz.c", "x"].sort,
|
64
|
+
fl.sort
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_create_with_brackets_and_filelist
|
68
|
+
fl = FileList[FileList["*.c", "x"]]
|
69
|
+
assert_equal ["abc.c", "x.c", "xyz.c", "x"].sort,
|
70
|
+
fl.sort
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_include_with_another_array
|
74
|
+
fl = FileList.new.include(["x", "y", "z"])
|
75
|
+
assert_equal ["x", "y", "z"].sort, fl.sort
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_include_with_another_filelist
|
79
|
+
fl = FileList.new.include(FileList["*.c", "x"])
|
80
|
+
assert_equal ["abc.c", "x.c", "xyz.c", "x"].sort,
|
81
|
+
fl.sort
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_include_with_pathname
|
85
|
+
fl = FileList.new.include(Pathname.new("*.c"))
|
86
|
+
assert_equal ["abc.c", "x.c", "xyz.c"].sort,
|
87
|
+
fl.sort
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_append
|
91
|
+
fl = FileList.new
|
92
|
+
fl << "a.rb" << "b.rb"
|
93
|
+
assert_equal ['a.rb', 'b.rb'], fl
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_append_pathname
|
97
|
+
fl = FileList.new
|
98
|
+
fl << Pathname.new("a.rb")
|
99
|
+
assert_equal ['a.rb'], fl
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_add_many
|
103
|
+
fl = FileList.new
|
104
|
+
fl.include %w(a d c)
|
105
|
+
fl.include('x', 'y')
|
106
|
+
assert_equal ['a', 'd', 'c', 'x', 'y'], fl
|
107
|
+
assert_equal ['a', 'd', 'c', 'x', 'y'], fl.resolve
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_add_return
|
111
|
+
f = FileList.new
|
112
|
+
g = f << "x"
|
113
|
+
assert_equal f.object_id, g.object_id
|
114
|
+
h = f.include("y")
|
115
|
+
assert_equal f.object_id, h.object_id
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_match
|
119
|
+
fl = FileList.new
|
120
|
+
fl.include '*.c'
|
121
|
+
|
122
|
+
assert_equal %w[abc.c x.c xyz.c], fl.sort
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_add_matching
|
126
|
+
fl = FileList.new
|
127
|
+
fl << "a.java"
|
128
|
+
fl.include '*.c'
|
129
|
+
|
130
|
+
assert_equal %w[a.java abc.c x.c xyz.c], fl.sort
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_multiple_patterns
|
134
|
+
fl = FileList.new
|
135
|
+
fl.include('*.z', '*foo*')
|
136
|
+
|
137
|
+
assert_equal [], fl
|
138
|
+
|
139
|
+
fl.include('*.c', '*xist*')
|
140
|
+
assert_equal %w[x.c xyz.c abc.c existing].sort, fl.sort
|
141
|
+
end
|
142
|
+
|
143
|
+
def test_square_bracket_pattern
|
144
|
+
fl = FileList.new
|
145
|
+
fl.include("abc.[ch]")
|
146
|
+
assert fl.size == 2
|
147
|
+
assert fl.include?("abc.c")
|
148
|
+
assert fl.include?("abc.h")
|
149
|
+
end
|
150
|
+
|
151
|
+
def test_curly_bracket_pattern
|
152
|
+
fl = FileList.new
|
153
|
+
fl.include("abc.{c,h}")
|
154
|
+
assert fl.size == 2
|
155
|
+
assert fl.include?("abc.c")
|
156
|
+
assert fl.include?("abc.h")
|
157
|
+
end
|
158
|
+
|
159
|
+
def test_reject
|
160
|
+
fl = FileList.new
|
161
|
+
fl.include %w(x.c abc.c xyz.c existing)
|
162
|
+
fl.reject! { |fn| fn =~ /^x/ }
|
163
|
+
assert_equal %w[abc.c existing], fl
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_exclude
|
167
|
+
fl = FileList['x.c', 'abc.c', 'xyz.c', 'existing']
|
168
|
+
fl.each { |fn| touch fn, :verbose => false }
|
169
|
+
|
170
|
+
x = fl.exclude(%r{^x.+\.})
|
171
|
+
|
172
|
+
assert_equal FileList, x.class
|
173
|
+
assert_equal %w(x.c abc.c existing), fl
|
174
|
+
assert_equal fl.object_id, x.object_id
|
175
|
+
|
176
|
+
fl.exclude('*.c')
|
177
|
+
|
178
|
+
assert_equal ['existing'], fl
|
179
|
+
|
180
|
+
fl.exclude('existing')
|
181
|
+
|
182
|
+
assert_equal [], fl
|
183
|
+
end
|
184
|
+
|
185
|
+
def test_exclude_pathname
|
186
|
+
fl = FileList['x.c', 'abc.c', 'other']
|
187
|
+
fl.each { |fn| touch fn, :verbose => false }
|
188
|
+
|
189
|
+
fl.exclude(Pathname.new('*.c'))
|
190
|
+
|
191
|
+
assert_equal ['other'], fl
|
192
|
+
end
|
193
|
+
|
194
|
+
def test_excluding_via_block
|
195
|
+
fl = FileList['a.c', 'b.c', 'xyz.c']
|
196
|
+
fl.exclude { |fn| fn.pathmap('%n') == 'xyz' }
|
197
|
+
assert fl.excluded_from_list?("xyz.c"), "Should exclude xyz.c"
|
198
|
+
assert_equal ['a.c', 'b.c'], fl
|
199
|
+
end
|
200
|
+
|
201
|
+
def test_exclude_return_on_create
|
202
|
+
fl = FileList['*'].exclude(/.*\.[hcx]$/)
|
203
|
+
assert_equal %w[cfiles existing xyzzy.txt], fl.sort
|
204
|
+
assert_equal FileList, fl.class
|
205
|
+
end
|
206
|
+
|
207
|
+
def test_exclude_with_string_return_on_create
|
208
|
+
fl = FileList['*'].exclude('abc.c')
|
209
|
+
assert_equal %w[abc.h abc.x cfiles existing x.c xyz.c xyzzy.txt], fl.sort
|
210
|
+
assert_equal FileList, fl.class
|
211
|
+
end
|
212
|
+
|
213
|
+
def test_exclude_curly_bracket_pattern
|
214
|
+
skip 'brace pattern matches not supported' unless defined? File::FNM_EXTGLOB
|
215
|
+
fl = FileList['*'].exclude('{abc,xyz}.c')
|
216
|
+
assert_equal %w[abc.h abc.x cfiles existing x.c xyzzy.txt], fl
|
217
|
+
end
|
218
|
+
|
219
|
+
def test_exclude_an_array
|
220
|
+
fl = FileList['*'].exclude(['existing', '*.c'])
|
221
|
+
assert_equal %w[abc.h abc.x cfiles xyzzy.txt], fl
|
222
|
+
end
|
223
|
+
|
224
|
+
def test_exclude_a_filelist
|
225
|
+
excluded = FileList['existing', '*.c']
|
226
|
+
fl = FileList['*'].exclude(excluded)
|
227
|
+
assert_equal %w[abc.h abc.x cfiles xyzzy.txt], fl
|
228
|
+
end
|
229
|
+
|
230
|
+
def test_default_exclude
|
231
|
+
fl = FileList.new
|
232
|
+
fl.clear_exclude
|
233
|
+
fl.include("**/*~", "**/*.bak", "**/core")
|
234
|
+
assert fl.member?("core"), "Should include core"
|
235
|
+
assert fl.member?("x.bak"), "Should include .bak files"
|
236
|
+
end
|
237
|
+
|
238
|
+
def test_unique
|
239
|
+
fl = FileList.new
|
240
|
+
fl << "x.c" << "a.c" << "b.rb" << "a.c"
|
241
|
+
assert_equal ['x.c', 'a.c', 'b.rb', 'a.c'], fl
|
242
|
+
fl.uniq!
|
243
|
+
assert_equal ['x.c', 'a.c', 'b.rb'], fl
|
244
|
+
end
|
245
|
+
|
246
|
+
def test_to_string
|
247
|
+
fl = FileList.new
|
248
|
+
fl << "a.java" << "b.java"
|
249
|
+
assert_equal "a.java b.java", fl.to_s
|
250
|
+
assert_equal "a.java b.java", "#{fl}"
|
251
|
+
end
|
252
|
+
|
253
|
+
def test_to_array
|
254
|
+
fl = FileList['a.java', 'b.java']
|
255
|
+
assert_equal ['a.java', 'b.java'], fl.to_a
|
256
|
+
assert_equal Array, fl.to_a.class
|
257
|
+
assert_equal ['a.java', 'b.java'], fl.to_ary
|
258
|
+
assert_equal Array, fl.to_ary.class
|
259
|
+
end
|
260
|
+
|
261
|
+
def test_to_s_pending
|
262
|
+
fl = FileList['abc.*']
|
263
|
+
result = fl.to_s
|
264
|
+
assert_match(%r{abc\.c}, result)
|
265
|
+
assert_match(%r{abc\.h}, result)
|
266
|
+
assert_match(%r{abc\.x}, result)
|
267
|
+
assert_match(%r{(abc\..\b ?){2}}, result)
|
268
|
+
end
|
269
|
+
|
270
|
+
def test_inspect_pending
|
271
|
+
fl = FileList['abc.*']
|
272
|
+
result = fl.inspect
|
273
|
+
assert_match(%r{"abc\.c"}, result)
|
274
|
+
assert_match(%r{"abc\.h"}, result)
|
275
|
+
assert_match(%r{"abc\.x"}, result)
|
276
|
+
assert_match(%r|^\[("abc\..", ){2}"abc\.."\]$|, result)
|
277
|
+
end
|
278
|
+
|
279
|
+
def test_sub
|
280
|
+
fl = FileList["*.c"]
|
281
|
+
f2 = fl.sub(/\.c$/, ".o")
|
282
|
+
assert_equal FileList, f2.class
|
283
|
+
assert_equal ["abc.o", "x.o", "xyz.o"].sort,
|
284
|
+
f2.sort
|
285
|
+
f3 = fl.gsub(/\.c$/, ".o")
|
286
|
+
assert_equal FileList, f3.class
|
287
|
+
assert_equal ["abc.o", "x.o", "xyz.o"].sort,
|
288
|
+
f3.sort
|
289
|
+
end
|
290
|
+
|
291
|
+
def test_claim_to_be_a_kind_of_array
|
292
|
+
fl = FileList['*.c']
|
293
|
+
assert fl.is_a?(Array)
|
294
|
+
assert fl.kind_of?(Array)
|
295
|
+
end
|
296
|
+
|
297
|
+
def test_claim_to_be_a_kind_of_filelist
|
298
|
+
fl = FileList['*.c']
|
299
|
+
assert fl.is_a?(FileList)
|
300
|
+
assert fl.kind_of?(FileList)
|
301
|
+
end
|
302
|
+
|
303
|
+
def test_claim_to_be_a_filelist_instance
|
304
|
+
fl = FileList['*.c']
|
305
|
+
assert fl.instance_of?(FileList)
|
306
|
+
end
|
307
|
+
|
308
|
+
def test_dont_claim_to_be_an_array_instance
|
309
|
+
fl = FileList['*.c']
|
310
|
+
assert ! fl.instance_of?(Array)
|
311
|
+
end
|
312
|
+
|
313
|
+
def test_sub!
|
314
|
+
f = "x/a.c"
|
315
|
+
fl = FileList[f, "x/b.c"]
|
316
|
+
res = fl.sub!(/\.c$/, ".o")
|
317
|
+
assert_equal ["x/a.o", "x/b.o"].sort, fl.sort
|
318
|
+
assert_equal "x/a.c", f
|
319
|
+
assert_equal fl.object_id, res.object_id
|
320
|
+
end
|
321
|
+
|
322
|
+
def test_sub_with_block
|
323
|
+
fl = FileList["src/org/onestepback/a.java", "src/org/onestepback/b.java"]
|
324
|
+
# The block version doesn't work the way I want it to ...
|
325
|
+
# f2 = fl.sub(%r{^src/(.*)\.java$}) { |x| "classes/" + $1 + ".class" }
|
326
|
+
f2 = fl.sub(%r{^src/(.*)\.java$}, "classes/\\1.class")
|
327
|
+
assert_equal [
|
328
|
+
"classes/org/onestepback/a.class",
|
329
|
+
"classes/org/onestepback/b.class"
|
330
|
+
].sort,
|
331
|
+
f2.sort
|
332
|
+
end
|
333
|
+
|
334
|
+
def test_string_ext
|
335
|
+
assert_equal "one.net", "one.two".ext("net")
|
336
|
+
assert_equal "one.net", "one.two".ext(".net")
|
337
|
+
assert_equal "one.net", "one".ext("net")
|
338
|
+
assert_equal "one.net", "one".ext(".net")
|
339
|
+
assert_equal "one.two.net", "one.two.c".ext(".net")
|
340
|
+
assert_equal "one/two.net", "one/two.c".ext(".net")
|
341
|
+
assert_equal "one.x/two.net", "one.x/two.c".ext(".net")
|
342
|
+
assert_equal "one.x/two.net", "one.x/two".ext(".net")
|
343
|
+
assert_equal ".onerc.net", ".onerc.dot".ext("net")
|
344
|
+
assert_equal ".onerc.net", ".onerc".ext("net")
|
345
|
+
assert_equal ".a/.onerc.net", ".a/.onerc".ext("net")
|
346
|
+
assert_equal "one", "one.two".ext('')
|
347
|
+
assert_equal "one", "one.two".ext
|
348
|
+
assert_equal ".one", ".one.two".ext
|
349
|
+
assert_equal ".one", ".one".ext
|
350
|
+
assert_equal ".", ".".ext("c")
|
351
|
+
assert_equal "..", "..".ext("c")
|
352
|
+
# These only need to work in windows
|
353
|
+
if Rake::Win32.windows?
|
354
|
+
assert_equal "one.x\\two.net", "one.x\\two.c".ext(".net")
|
355
|
+
assert_equal "one.x\\two.net", "one.x\\two".ext(".net")
|
356
|
+
end
|
357
|
+
end
|
358
|
+
|
359
|
+
def test_filelist_ext
|
360
|
+
assert_equal FileList['one.c', '.one.c'],
|
361
|
+
FileList['one.net', '.one'].ext('c')
|
362
|
+
end
|
363
|
+
|
364
|
+
def test_gsub
|
365
|
+
fl = FileList["*.c"]
|
366
|
+
f2 = fl.gsub(/a/, "A")
|
367
|
+
assert_equal ["Abc.c", "x.c", "xyz.c"].sort,
|
368
|
+
f2.sort
|
369
|
+
end
|
370
|
+
|
371
|
+
def test_gsub!
|
372
|
+
f = FileList["*.c"]
|
373
|
+
f.gsub!(/a/, "A")
|
374
|
+
assert_equal ["Abc.c", "x.c", "xyz.c"].sort,
|
375
|
+
f.sort
|
376
|
+
end
|
377
|
+
|
378
|
+
def test_egrep_returns_0_if_no_matches
|
379
|
+
files = FileList['test/lib/*_test.rb'].exclude("test/lib/filelist_test.rb")
|
380
|
+
assert_equal 0, files.egrep(/XYZZY/) { }
|
381
|
+
end
|
382
|
+
|
383
|
+
def test_egrep_with_output
|
384
|
+
files = FileList['*.txt']
|
385
|
+
|
386
|
+
out, = capture_io do
|
387
|
+
files.egrep(/XYZZY/)
|
388
|
+
end
|
389
|
+
|
390
|
+
assert_equal "xyzzy.txt:2:XYZZY\n", out
|
391
|
+
end
|
392
|
+
|
393
|
+
def test_egrep_with_block
|
394
|
+
files = FileList['*.txt']
|
395
|
+
found = nil
|
396
|
+
|
397
|
+
files.egrep(/XYZZY/) do |fn, ln, line|
|
398
|
+
found = [fn, ln, line]
|
399
|
+
end
|
400
|
+
|
401
|
+
assert_equal ["xyzzy.txt", 2, "XYZZY\n"], found
|
402
|
+
end
|
403
|
+
|
404
|
+
def test_egrep_with_error
|
405
|
+
files = FileList['*.txt']
|
406
|
+
|
407
|
+
_, err = capture_io do
|
408
|
+
files.egrep(/XYZZY/) do |fn, ln, line |
|
409
|
+
raise "_EGREP_FAILURE_"
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
assert_equal "Error while processing 'xyzzy.txt': _EGREP_FAILURE_\n", err
|
414
|
+
end
|
415
|
+
|
416
|
+
def test_existing
|
417
|
+
fl = FileList['abc.c', 'notthere.c']
|
418
|
+
assert_equal ["abc.c"], fl.existing
|
419
|
+
assert fl.existing.is_a?(FileList)
|
420
|
+
end
|
421
|
+
|
422
|
+
def test_existing!
|
423
|
+
fl = FileList['abc.c', 'notthere.c']
|
424
|
+
result = fl.existing!
|
425
|
+
assert_equal ["abc.c"], fl
|
426
|
+
assert_equal fl.object_id, result.object_id
|
427
|
+
end
|
428
|
+
|
429
|
+
def test_ignore_special
|
430
|
+
f = FileList['*']
|
431
|
+
assert ! f.include?("CVS"), "Should not contain CVS"
|
432
|
+
assert ! f.include?(".svn"), "Should not contain .svn"
|
433
|
+
assert ! f.include?(".dummy"), "Should not contain dot files"
|
434
|
+
assert ! f.include?("x.bak"), "Should not contain .bak files"
|
435
|
+
assert ! f.include?("x~"), "Should not contain ~ files"
|
436
|
+
assert ! f.include?("core"), "Should not contain core files"
|
437
|
+
end
|
438
|
+
|
439
|
+
def test_clear_ignore_patterns
|
440
|
+
f = FileList['*', '.svn']
|
441
|
+
f.clear_exclude
|
442
|
+
assert f.include?("abc.c")
|
443
|
+
assert f.include?("xyz.c")
|
444
|
+
assert f.include?("CVS")
|
445
|
+
assert f.include?(".svn")
|
446
|
+
assert f.include?("x.bak")
|
447
|
+
assert f.include?("x~")
|
448
|
+
end
|
449
|
+
|
450
|
+
def test_exclude_with_alternate_file_seps
|
451
|
+
fl = FileList.new
|
452
|
+
assert fl.excluded_from_list?("x/CVS/y")
|
453
|
+
assert fl.excluded_from_list?("x\\CVS\\y")
|
454
|
+
assert fl.excluded_from_list?("x/.svn/y")
|
455
|
+
assert fl.excluded_from_list?("x\\.svn\\y")
|
456
|
+
assert fl.excluded_from_list?("x/core")
|
457
|
+
assert fl.excluded_from_list?("x\\core")
|
458
|
+
end
|
459
|
+
|
460
|
+
def test_add_default_exclude_list
|
461
|
+
fl = FileList.new
|
462
|
+
fl.exclude(/~\d+$/)
|
463
|
+
assert fl.excluded_from_list?("x/CVS/y")
|
464
|
+
assert fl.excluded_from_list?("x\\CVS\\y")
|
465
|
+
assert fl.excluded_from_list?("x/.svn/y")
|
466
|
+
assert fl.excluded_from_list?("x\\.svn\\y")
|
467
|
+
assert fl.excluded_from_list?("x/core")
|
468
|
+
assert fl.excluded_from_list?("x\\core")
|
469
|
+
assert fl.excluded_from_list?("x/abc~1")
|
470
|
+
end
|
471
|
+
|
472
|
+
def test_basic_array_functions
|
473
|
+
f = FileList['b', 'c', 'a']
|
474
|
+
assert_equal 'b', f.first
|
475
|
+
assert_equal 'b', f[0]
|
476
|
+
assert_equal 'a', f.last
|
477
|
+
assert_equal 'a', f[2]
|
478
|
+
assert_equal 'a', f[-1]
|
479
|
+
assert_equal ['a', 'b', 'c'], f.sort
|
480
|
+
f.sort!
|
481
|
+
assert_equal ['a', 'b', 'c'], f
|
482
|
+
end
|
483
|
+
|
484
|
+
def test_flatten
|
485
|
+
assert_equal ['a', 'x.c', 'xyz.c', 'abc.c'].sort,
|
486
|
+
['a', FileList['*.c']].flatten.sort
|
487
|
+
end
|
488
|
+
|
489
|
+
def test_clone_and_dup
|
490
|
+
a = FileList['a', 'b', 'c']
|
491
|
+
c = a.clone
|
492
|
+
d = a.dup
|
493
|
+
a << 'd'
|
494
|
+
assert_equal ['a', 'b', 'c', 'd'], a
|
495
|
+
assert_equal ['a', 'b', 'c'], c
|
496
|
+
assert_equal ['a', 'b', 'c'], d
|
497
|
+
end
|
498
|
+
|
499
|
+
def test_dup_and_clone_replicate_taint
|
500
|
+
a = FileList['a', 'b', 'c']
|
501
|
+
a.taint
|
502
|
+
c = a.clone
|
503
|
+
d = a.dup
|
504
|
+
assert c.tainted?, "Clone should be tainted"
|
505
|
+
assert d.tainted?, "Dup should be tainted"
|
506
|
+
end
|
507
|
+
|
508
|
+
def test_duped_items_will_thaw
|
509
|
+
a = FileList['a', 'b', 'c']
|
510
|
+
a.freeze
|
511
|
+
d = a.dup
|
512
|
+
d << 'more'
|
513
|
+
assert_equal ['a', 'b', 'c', 'more'], d
|
514
|
+
end
|
515
|
+
|
516
|
+
def test_cloned_items_stay_frozen
|
517
|
+
a = FileList['a', 'b', 'c']
|
518
|
+
a.freeze
|
519
|
+
c = a.clone
|
520
|
+
assert_raises(TypeError, RuntimeError) do
|
521
|
+
c << 'more'
|
522
|
+
end
|
523
|
+
end
|
524
|
+
|
525
|
+
def test_array_comparisons
|
526
|
+
fl = FileList['b', 'b']
|
527
|
+
a = ['b', 'a']
|
528
|
+
b = ['b', 'b']
|
529
|
+
c = ['b', 'c']
|
530
|
+
assert_equal(1, fl <=> a)
|
531
|
+
assert_equal(0, fl <=> b)
|
532
|
+
assert_equal(-1, fl <=> c)
|
533
|
+
assert_equal(-1, a <=> fl)
|
534
|
+
assert_equal(0, b <=> fl)
|
535
|
+
assert_equal(1, c <=> fl)
|
536
|
+
end
|
537
|
+
|
538
|
+
def test_array_equality
|
539
|
+
a = FileList['a', 'b']
|
540
|
+
b = ['a', 'b']
|
541
|
+
assert a == b
|
542
|
+
assert b == a
|
543
|
+
# assert a.eql?(b)
|
544
|
+
# assert b.eql?(a)
|
545
|
+
assert ! a.equal?(b)
|
546
|
+
assert ! b.equal?(a)
|
547
|
+
end
|
548
|
+
|
549
|
+
def test_enumeration_methods
|
550
|
+
a = FileList['a', 'b']
|
551
|
+
b = a.map { |it| it.upcase }
|
552
|
+
assert_equal ['A', 'B'], b
|
553
|
+
assert_equal FileList, b.class
|
554
|
+
|
555
|
+
b = a.map { |it| it.upcase }
|
556
|
+
assert_equal ['A', 'B'], b
|
557
|
+
assert_equal FileList, b.class
|
558
|
+
|
559
|
+
b = a.sort
|
560
|
+
assert_equal ['a', 'b'], b
|
561
|
+
assert_equal FileList, b.class
|
562
|
+
|
563
|
+
b = a.sort_by { |it| it }
|
564
|
+
assert_equal ['a', 'b'], b
|
565
|
+
assert_equal FileList, b.class
|
566
|
+
|
567
|
+
b = a.select { |it| it == 'b' }
|
568
|
+
assert_equal ['b'], b
|
569
|
+
assert_equal FileList, b.class
|
570
|
+
|
571
|
+
b = a.select { |it| it.size == 1 }
|
572
|
+
assert_equal ['a', 'b'], b
|
573
|
+
assert_equal FileList, b.class
|
574
|
+
|
575
|
+
b = a.reject { |it| it == 'b' }
|
576
|
+
assert_equal ['a'], b
|
577
|
+
assert_equal FileList, b.class
|
578
|
+
|
579
|
+
b = a.grep(/./)
|
580
|
+
assert_equal ['a', 'b'], b
|
581
|
+
assert_equal FileList, b.class
|
582
|
+
|
583
|
+
b = a.partition { |it| it == 'b' }
|
584
|
+
assert_equal [['b'], ['a']], b
|
585
|
+
assert_equal Array, b.class
|
586
|
+
assert_equal FileList, b[0].class
|
587
|
+
assert_equal FileList, b[1].class
|
588
|
+
|
589
|
+
b = a.zip(['x', 'y']).to_a
|
590
|
+
assert_equal [['a', 'x'], ['b', 'y']], b
|
591
|
+
assert_equal Array, b.class
|
592
|
+
assert_equal Array, b[0].class
|
593
|
+
assert_equal Array, b[1].class
|
594
|
+
end
|
595
|
+
|
596
|
+
def test_array_operators
|
597
|
+
a = ['a', 'b']
|
598
|
+
b = ['c', 'd']
|
599
|
+
f = FileList['x', 'y']
|
600
|
+
g = FileList['w', 'z']
|
601
|
+
|
602
|
+
r = f + g
|
603
|
+
assert_equal ['x', 'y', 'w', 'z'], r
|
604
|
+
assert_equal FileList, r.class
|
605
|
+
|
606
|
+
r = a + g
|
607
|
+
assert_equal ['a', 'b', 'w', 'z'], r
|
608
|
+
assert_equal Array, r.class
|
609
|
+
|
610
|
+
r = f + b
|
611
|
+
assert_equal ['x', 'y', 'c', 'd'], r
|
612
|
+
assert_equal FileList, r.class
|
613
|
+
|
614
|
+
r = FileList['w', 'x', 'y', 'z'] - f
|
615
|
+
assert_equal ['w', 'z'], r
|
616
|
+
assert_equal FileList, r.class
|
617
|
+
|
618
|
+
r = FileList['w', 'x', 'y', 'z'] & f
|
619
|
+
assert_equal ['x', 'y'], r
|
620
|
+
assert_equal FileList, r.class
|
621
|
+
|
622
|
+
r = f * 2
|
623
|
+
assert_equal ['x', 'y', 'x', 'y'], r
|
624
|
+
assert_equal FileList, r.class
|
625
|
+
|
626
|
+
r = f * ','
|
627
|
+
assert_equal 'x,y', r
|
628
|
+
assert_equal String, r.class
|
629
|
+
|
630
|
+
r = f | ['a', 'x']
|
631
|
+
assert_equal ['a', 'x', 'y'].sort, r.sort
|
632
|
+
assert_equal FileList, r.class
|
633
|
+
end
|
634
|
+
|
635
|
+
def test_other_array_returning_methods
|
636
|
+
f = FileList['a', nil, 'b']
|
637
|
+
r = f.compact
|
638
|
+
assert_equal ['a', 'b'], r
|
639
|
+
assert_equal FileList, r.class
|
640
|
+
|
641
|
+
f = FileList['a', 'b']
|
642
|
+
r = f.concat(['x', 'y'])
|
643
|
+
assert_equal ['a', 'b', 'x', 'y'], r
|
644
|
+
assert_equal FileList, r.class
|
645
|
+
|
646
|
+
f = FileList['a', ['b', 'c'], FileList['d', 'e']]
|
647
|
+
r = f.flatten
|
648
|
+
assert_equal ['a', 'b', 'c', 'd', 'e'], r
|
649
|
+
assert_equal FileList, r.class
|
650
|
+
|
651
|
+
f = FileList['a', 'b', 'a']
|
652
|
+
r = f.uniq
|
653
|
+
assert_equal ['a', 'b'], r
|
654
|
+
assert_equal FileList, r.class
|
655
|
+
|
656
|
+
f = FileList['a', 'b', 'c', 'd']
|
657
|
+
r = f.values_at(1, 3)
|
658
|
+
assert_equal ['b', 'd'], r
|
659
|
+
assert_equal FileList, r.class
|
660
|
+
end
|
661
|
+
|
662
|
+
def test_special_return_delegating_methods_object_type
|
663
|
+
custom_file_list = Class.new(FileList)
|
664
|
+
f = custom_file_list.new
|
665
|
+
|
666
|
+
FileList::SPECIAL_RETURN.each do |m|
|
667
|
+
r = if [].method(m).arity == 1
|
668
|
+
f.send(m, [])
|
669
|
+
else
|
670
|
+
f.send(m)
|
671
|
+
end
|
672
|
+
|
673
|
+
assert_equal custom_file_list, r.class
|
674
|
+
end
|
675
|
+
end
|
676
|
+
|
677
|
+
def test_file_utils_can_use_filelists
|
678
|
+
cfiles = FileList['*.c']
|
679
|
+
|
680
|
+
cp cfiles, @cdir, :verbose => false
|
681
|
+
|
682
|
+
assert File.exist?(File.join(@cdir, 'abc.c'))
|
683
|
+
assert File.exist?(File.join(@cdir, 'xyz.c'))
|
684
|
+
assert File.exist?(File.join(@cdir, 'x.c'))
|
685
|
+
end
|
686
|
+
|
687
|
+
end
|