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,34 @@
|
|
1
|
+
module RubyRunner
|
2
|
+
include FileUtils
|
3
|
+
|
4
|
+
# Run a shell Ruby command with command line options (using the
|
5
|
+
# default test options). Output is captured in @out and @err
|
6
|
+
def ruby(*option_list)
|
7
|
+
run_ruby(@ruby_options + option_list)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Run a command line rake with the give rake options. Default
|
11
|
+
# command line ruby options are included. Output is captured in
|
12
|
+
# @out and @err
|
13
|
+
def rake(*rake_options)
|
14
|
+
run_ruby @ruby_options + [@rake_exec] + rake_options
|
15
|
+
end
|
16
|
+
|
17
|
+
# Low level ruby command runner ...
|
18
|
+
def run_ruby(option_list)
|
19
|
+
puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
|
20
|
+
|
21
|
+
Open3.popen3(RUBY, *option_list) {|inn, out, err, wait|
|
22
|
+
inn.close
|
23
|
+
|
24
|
+
@exit = wait ? wait.value : $?
|
25
|
+
@out = out.read
|
26
|
+
@err = err.read
|
27
|
+
}
|
28
|
+
|
29
|
+
puts "OUTPUT: [#{@out}]" if @verbose
|
30
|
+
puts "ERROR: [#{@err}]" if @verbose
|
31
|
+
puts "EXIT: [#{@exit.inspect}]" if @verbose
|
32
|
+
puts "PWD: [#{Dir.pwd}]" if @verbose
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
require 'rake/private_reader'
|
3
|
+
|
4
|
+
class TestPrivateAttrs < Rake::TestCase
|
5
|
+
|
6
|
+
class Sample
|
7
|
+
include Rake::PrivateReader
|
8
|
+
|
9
|
+
private_reader :reader, :a
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
@reader = :RVALUE
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_reader
|
16
|
+
reader
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def setup
|
22
|
+
super
|
23
|
+
@sample = Sample.new
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_private_reader_is_private
|
27
|
+
assert_private do @sample.reader end
|
28
|
+
assert_private do @sample.a end
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_private_reader_returns_data
|
32
|
+
assert_equal :RVALUE, @sample.get_reader
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def assert_private
|
38
|
+
ex = assert_raises(NoMethodError) do yield end
|
39
|
+
assert_match(/private/, ex.message)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
|
3
|
+
class TestRake < Rake::TestCase
|
4
|
+
def test_each_dir_parent
|
5
|
+
assert_equal ['a'], alldirs('a')
|
6
|
+
assert_equal ['a/b', 'a'], alldirs('a/b')
|
7
|
+
assert_equal ['/a/b', '/a', '/'], alldirs('/a/b')
|
8
|
+
if File.dirname("c:/foo") == "c:"
|
9
|
+
# Under Unix
|
10
|
+
assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b')
|
11
|
+
assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
|
12
|
+
else
|
13
|
+
# Under Windows
|
14
|
+
assert_equal ['c:/a/b', 'c:/a', 'c:/'], alldirs('c:/a/b')
|
15
|
+
assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def alldirs(fn)
|
20
|
+
result = []
|
21
|
+
Rake.each_dir_parent(fn) { |d| result << d }
|
22
|
+
result
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_can_override_application
|
26
|
+
old_app = Rake.application
|
27
|
+
fake_app = Object.new
|
28
|
+
Rake.application = fake_app
|
29
|
+
|
30
|
+
assert_equal fake_app, Rake.application
|
31
|
+
|
32
|
+
ensure
|
33
|
+
Rake.application = old_app
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_original_dir_reports_current_dir
|
37
|
+
assert_equal @tempdir, Rake.original_dir
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,659 @@
|
|
1
|
+
#encoding: UTF-8
|
2
|
+
require File.expand_path('../helper', __FILE__)
|
3
|
+
|
4
|
+
class TestRakeApplication < Rake::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
|
9
|
+
@app = Rake.application
|
10
|
+
@app.options.rakelib = []
|
11
|
+
end
|
12
|
+
|
13
|
+
def setup_command_line(*options)
|
14
|
+
ARGV.clear
|
15
|
+
options.each do |option|
|
16
|
+
ARGV << option
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_display_exception_details
|
21
|
+
obj = Object.new
|
22
|
+
obj.instance_eval("def #{__method__}; raise 'test'; end", "ruby")
|
23
|
+
begin
|
24
|
+
obj.__send__(__method__)
|
25
|
+
rescue => ex
|
26
|
+
end
|
27
|
+
|
28
|
+
out, err = capture_io do
|
29
|
+
@app.display_error_message ex
|
30
|
+
end
|
31
|
+
|
32
|
+
assert_empty out
|
33
|
+
|
34
|
+
assert_match 'rake aborted!', err
|
35
|
+
assert_match __method__.to_s, err
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_display_exception_details_bad_encoding
|
39
|
+
begin
|
40
|
+
raise 'El Niño is coming!'.force_encoding('US-ASCII')
|
41
|
+
rescue => ex
|
42
|
+
end
|
43
|
+
|
44
|
+
out, err = capture_io do
|
45
|
+
@app.display_error_message ex
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_empty out
|
49
|
+
assert_match 'El Niño is coming!', err.force_encoding('UTF-8')
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_display_exception_details_cause
|
53
|
+
skip 'Exception#cause not implemented' unless
|
54
|
+
Exception.method_defined? :cause
|
55
|
+
|
56
|
+
begin
|
57
|
+
raise 'cause a'
|
58
|
+
rescue
|
59
|
+
begin
|
60
|
+
raise 'cause b'
|
61
|
+
rescue => ex
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
out, err = capture_io do
|
66
|
+
@app.display_error_message ex
|
67
|
+
end
|
68
|
+
|
69
|
+
assert_empty out
|
70
|
+
|
71
|
+
assert_match 'cause a', err
|
72
|
+
assert_match 'cause b', err
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_display_exception_details_cause_loop
|
76
|
+
skip 'Exception#cause not implemented' unless
|
77
|
+
Exception.method_defined? :cause
|
78
|
+
skip if jruby9? # https://github.com/jruby/jruby/issues/3654
|
79
|
+
|
80
|
+
begin
|
81
|
+
begin
|
82
|
+
raise 'cause a'
|
83
|
+
rescue => a
|
84
|
+
begin
|
85
|
+
raise 'cause b'
|
86
|
+
rescue
|
87
|
+
raise a
|
88
|
+
end
|
89
|
+
end
|
90
|
+
rescue => ex
|
91
|
+
end
|
92
|
+
|
93
|
+
out, err = capture_io do
|
94
|
+
@app.display_error_message ex
|
95
|
+
end
|
96
|
+
|
97
|
+
assert_empty out
|
98
|
+
|
99
|
+
assert_match 'cause a', err
|
100
|
+
assert_match 'cause b', err
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_display_tasks
|
104
|
+
@app.options.show_tasks = :tasks
|
105
|
+
@app.options.show_task_pattern = //
|
106
|
+
@app.last_description = "COMMENT"
|
107
|
+
@app.define_task(Rake::Task, "t")
|
108
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
109
|
+
assert_match(/^rake t/, out)
|
110
|
+
assert_match(/# COMMENT/, out)
|
111
|
+
end
|
112
|
+
|
113
|
+
def test_display_tasks_with_long_comments
|
114
|
+
@app.terminal_columns = 80
|
115
|
+
@app.options.show_tasks = :tasks
|
116
|
+
@app.options.show_task_pattern = //
|
117
|
+
numbers = "1234567890" * 8
|
118
|
+
@app.last_description = numbers
|
119
|
+
@app.define_task(Rake::Task, "t")
|
120
|
+
|
121
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
122
|
+
|
123
|
+
assert_match(/^rake t/, out)
|
124
|
+
assert_match(/# #{numbers[0, 65]}\.\.\./, out)
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_display_tasks_with_task_name_wider_than_tty_display
|
128
|
+
@app.terminal_columns = 80
|
129
|
+
@app.options.show_tasks = :tasks
|
130
|
+
@app.options.show_task_pattern = //
|
131
|
+
task_name = "task name" * 80
|
132
|
+
@app.last_description = "something short"
|
133
|
+
@app.define_task(Rake::Task, task_name)
|
134
|
+
|
135
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
136
|
+
|
137
|
+
# Ensure the entire task name is output and we end up showing no description
|
138
|
+
assert_match(/rake #{task_name} # .../, out)
|
139
|
+
end
|
140
|
+
|
141
|
+
def test_display_tasks_with_very_long_task_name_to_a_non_tty_shows_name_and_comment
|
142
|
+
@app.options.show_tasks = :tasks
|
143
|
+
@app.options.show_task_pattern = //
|
144
|
+
@app.tty_output = false
|
145
|
+
description = "something short"
|
146
|
+
task_name = "task name" * 80
|
147
|
+
@app.last_description = "something short"
|
148
|
+
@app.define_task(Rake::Task, task_name)
|
149
|
+
|
150
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
151
|
+
|
152
|
+
# Ensure the entire task name is output and we end up showing no description
|
153
|
+
assert_match(/rake #{task_name} # #{description}/, out)
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_display_tasks_with_long_comments_to_a_non_tty_shows_entire_comment
|
157
|
+
@app.options.show_tasks = :tasks
|
158
|
+
@app.options.show_task_pattern = //
|
159
|
+
@app.tty_output = false
|
160
|
+
@app.last_description = "1234567890" * 8
|
161
|
+
@app.define_task(Rake::Task, "t")
|
162
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
163
|
+
assert_match(/^rake t/, out)
|
164
|
+
assert_match(/# #{@app.last_description}/, out)
|
165
|
+
end
|
166
|
+
|
167
|
+
def test_truncating_comments_to_a_non_tty
|
168
|
+
@app.terminal_columns = 80
|
169
|
+
@app.options.show_tasks = :tasks
|
170
|
+
@app.options.show_task_pattern = //
|
171
|
+
@app.tty_output = false
|
172
|
+
numbers = "1234567890" * 8
|
173
|
+
@app.last_description = numbers
|
174
|
+
@app.define_task(Rake::Task, "t")
|
175
|
+
|
176
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
177
|
+
|
178
|
+
assert_match(/^rake t/, out)
|
179
|
+
assert_match(/# #{numbers[0, 65]}\.\.\./, out)
|
180
|
+
end
|
181
|
+
|
182
|
+
def test_describe_tasks
|
183
|
+
@app.options.show_tasks = :describe
|
184
|
+
@app.options.show_task_pattern = //
|
185
|
+
@app.last_description = "COMMENT"
|
186
|
+
@app.define_task(Rake::Task, "t")
|
187
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
188
|
+
assert_match(/^rake t$/, out)
|
189
|
+
assert_match(/^ {4}COMMENT$/, out)
|
190
|
+
end
|
191
|
+
|
192
|
+
def test_show_lines
|
193
|
+
@app.options.show_tasks = :lines
|
194
|
+
@app.options.show_task_pattern = //
|
195
|
+
@app.last_description = "COMMENT"
|
196
|
+
@app.define_task(Rake::Task, "t")
|
197
|
+
@app['t'].locations << "HERE:1"
|
198
|
+
out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
|
199
|
+
assert_match(/^rake t +[^:]+:\d+ *$/, out)
|
200
|
+
end
|
201
|
+
|
202
|
+
def test_finding_rakefile
|
203
|
+
rakefile_default
|
204
|
+
|
205
|
+
assert_match(/Rakefile/i, @app.instance_eval { have_rakefile })
|
206
|
+
end
|
207
|
+
|
208
|
+
def test_not_finding_rakefile
|
209
|
+
@app.instance_eval { @rakefiles = ['NEVER_FOUND'] }
|
210
|
+
assert(! @app.instance_eval do have_rakefile end)
|
211
|
+
assert_nil @app.rakefile
|
212
|
+
end
|
213
|
+
|
214
|
+
def test_load_rakefile
|
215
|
+
rakefile_unittest
|
216
|
+
|
217
|
+
@app.instance_eval do
|
218
|
+
handle_options
|
219
|
+
options.silent = true
|
220
|
+
load_rakefile
|
221
|
+
end
|
222
|
+
|
223
|
+
assert_equal "rakefile", @app.rakefile.downcase
|
224
|
+
assert_equal @tempdir, Dir.pwd
|
225
|
+
end
|
226
|
+
|
227
|
+
def test_load_rakefile_doesnt_print_rakefile_directory_from_same_dir
|
228
|
+
rakefile_unittest
|
229
|
+
|
230
|
+
_, err = capture_io do
|
231
|
+
@app.instance_eval do
|
232
|
+
# pretend we started from the unittest dir
|
233
|
+
@original_dir = File.expand_path(".")
|
234
|
+
raw_load_rakefile
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
assert_empty err
|
239
|
+
end
|
240
|
+
|
241
|
+
def test_load_rakefile_from_subdir
|
242
|
+
rakefile_unittest
|
243
|
+
Dir.chdir 'subdir'
|
244
|
+
|
245
|
+
@app.instance_eval do
|
246
|
+
handle_options
|
247
|
+
options.silent = true
|
248
|
+
load_rakefile
|
249
|
+
end
|
250
|
+
|
251
|
+
assert_equal "rakefile", @app.rakefile.downcase
|
252
|
+
assert_equal @tempdir, Dir.pwd
|
253
|
+
end
|
254
|
+
|
255
|
+
def test_load_rakefile_prints_rakefile_directory_from_subdir
|
256
|
+
rakefile_unittest
|
257
|
+
Dir.chdir 'subdir'
|
258
|
+
|
259
|
+
app = Rake::Application.new
|
260
|
+
app.options.rakelib = []
|
261
|
+
|
262
|
+
_, err = capture_io do
|
263
|
+
app.instance_eval do
|
264
|
+
raw_load_rakefile
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
assert_equal "(in #{@tempdir}\)\n", err
|
269
|
+
end
|
270
|
+
|
271
|
+
def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent
|
272
|
+
rakefile_unittest
|
273
|
+
Dir.chdir 'subdir'
|
274
|
+
|
275
|
+
_, err = capture_io do
|
276
|
+
@app.instance_eval do
|
277
|
+
handle_options
|
278
|
+
options.silent = true
|
279
|
+
raw_load_rakefile
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
assert_empty err
|
284
|
+
end
|
285
|
+
|
286
|
+
def test_load_rakefile_not_found
|
287
|
+
ARGV.clear
|
288
|
+
Dir.chdir @tempdir
|
289
|
+
ENV['RAKE_SYSTEM'] = 'not_exist'
|
290
|
+
|
291
|
+
@app.instance_eval do
|
292
|
+
handle_options
|
293
|
+
options.silent = true
|
294
|
+
end
|
295
|
+
|
296
|
+
|
297
|
+
ex = assert_raises(RuntimeError) do
|
298
|
+
@app.instance_eval do
|
299
|
+
raw_load_rakefile
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
assert_match(/no rakefile found/i, ex.message)
|
304
|
+
end
|
305
|
+
|
306
|
+
def test_load_from_system_rakefile
|
307
|
+
rake_system_dir
|
308
|
+
|
309
|
+
@app.instance_eval do
|
310
|
+
handle_options
|
311
|
+
options.silent = true
|
312
|
+
options.load_system = true
|
313
|
+
options.rakelib = []
|
314
|
+
load_rakefile
|
315
|
+
end
|
316
|
+
|
317
|
+
assert_equal @system_dir, @app.system_dir
|
318
|
+
assert_nil @app.rakefile
|
319
|
+
rescue SystemExit
|
320
|
+
flunk 'failed to load rakefile'
|
321
|
+
end
|
322
|
+
|
323
|
+
def test_load_from_calculated_system_rakefile
|
324
|
+
rakefile_default
|
325
|
+
def @app.standard_system_dir
|
326
|
+
"__STD_SYS_DIR__"
|
327
|
+
end
|
328
|
+
|
329
|
+
ENV['RAKE_SYSTEM'] = nil
|
330
|
+
|
331
|
+
@app.instance_eval do
|
332
|
+
handle_options
|
333
|
+
options.silent = true
|
334
|
+
options.load_system = true
|
335
|
+
options.rakelib = []
|
336
|
+
load_rakefile
|
337
|
+
end
|
338
|
+
|
339
|
+
assert_equal "__STD_SYS_DIR__", @app.system_dir
|
340
|
+
rescue SystemExit
|
341
|
+
flunk 'failed to find system rakefile'
|
342
|
+
end
|
343
|
+
|
344
|
+
def test_terminal_columns
|
345
|
+
old_rake_columns = ENV['RAKE_COLUMNS']
|
346
|
+
|
347
|
+
ENV['RAKE_COLUMNS'] = '42'
|
348
|
+
|
349
|
+
app = Rake::Application.new
|
350
|
+
|
351
|
+
assert_equal 42, app.terminal_columns
|
352
|
+
ensure
|
353
|
+
if old_rake_columns
|
354
|
+
ENV['RAKE_COLUMNS'].delete
|
355
|
+
else
|
356
|
+
ENV['RAKE_COLUMNS'] = old_rake_columns
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
def test_windows
|
361
|
+
assert ! (@app.windows? && @app.unix?)
|
362
|
+
end
|
363
|
+
|
364
|
+
def test_loading_imports
|
365
|
+
loader = util_loader
|
366
|
+
|
367
|
+
@app.instance_eval do
|
368
|
+
add_loader("dummy", loader)
|
369
|
+
add_import("x.dummy")
|
370
|
+
load_imports
|
371
|
+
end
|
372
|
+
|
373
|
+
# HACK no assertions
|
374
|
+
end
|
375
|
+
|
376
|
+
def test_building_imported_files_on_demand
|
377
|
+
loader = util_loader
|
378
|
+
|
379
|
+
@app.instance_eval do
|
380
|
+
intern(Rake::Task, "x.dummy").enhance do loader.make_dummy end
|
381
|
+
add_loader("dummy", loader)
|
382
|
+
add_import("x.dummy")
|
383
|
+
load_imports
|
384
|
+
end
|
385
|
+
|
386
|
+
# HACK no assertions
|
387
|
+
end
|
388
|
+
|
389
|
+
def test_handle_options_should_not_strip_options_from_argv
|
390
|
+
assert !@app.options.trace
|
391
|
+
|
392
|
+
valid_option = '--trace'
|
393
|
+
setup_command_line(valid_option)
|
394
|
+
|
395
|
+
@app.handle_options
|
396
|
+
|
397
|
+
assert ARGV.include?(valid_option)
|
398
|
+
assert @app.options.trace
|
399
|
+
end
|
400
|
+
|
401
|
+
def test_handle_options_trace_default_is_stderr
|
402
|
+
setup_command_line("--trace")
|
403
|
+
|
404
|
+
@app.handle_options
|
405
|
+
|
406
|
+
assert_equal STDERR, @app.options.trace_output
|
407
|
+
assert @app.options.trace
|
408
|
+
end
|
409
|
+
|
410
|
+
def test_handle_options_trace_overrides_to_stdout
|
411
|
+
setup_command_line("--trace=stdout")
|
412
|
+
|
413
|
+
@app.handle_options
|
414
|
+
|
415
|
+
assert_equal STDOUT, @app.options.trace_output
|
416
|
+
assert @app.options.trace
|
417
|
+
end
|
418
|
+
|
419
|
+
def test_handle_options_trace_does_not_eat_following_task_names
|
420
|
+
assert !@app.options.trace
|
421
|
+
|
422
|
+
setup_command_line("--trace", "sometask")
|
423
|
+
|
424
|
+
@app.handle_options
|
425
|
+
assert ARGV.include?("sometask")
|
426
|
+
assert @app.options.trace
|
427
|
+
end
|
428
|
+
|
429
|
+
def test_good_run
|
430
|
+
ran = false
|
431
|
+
|
432
|
+
ARGV << '--rakelib=""'
|
433
|
+
|
434
|
+
@app.options.silent = true
|
435
|
+
|
436
|
+
@app.instance_eval do
|
437
|
+
intern(Rake::Task, "default").enhance { ran = true }
|
438
|
+
end
|
439
|
+
|
440
|
+
rakefile_default
|
441
|
+
|
442
|
+
out, err = capture_io do
|
443
|
+
@app.run
|
444
|
+
end
|
445
|
+
|
446
|
+
assert ran
|
447
|
+
assert_empty err
|
448
|
+
assert_equal "DEFAULT\n", out
|
449
|
+
end
|
450
|
+
|
451
|
+
def test_display_task_run
|
452
|
+
ran = false
|
453
|
+
setup_command_line('-f', '-s', '--tasks', '--rakelib=""')
|
454
|
+
@app.last_description = "COMMENT"
|
455
|
+
@app.define_task(Rake::Task, "default")
|
456
|
+
out, = capture_io { @app.run }
|
457
|
+
assert @app.options.show_tasks
|
458
|
+
assert ! ran
|
459
|
+
assert_match(/rake default/, out)
|
460
|
+
assert_match(/# COMMENT/, out)
|
461
|
+
end
|
462
|
+
|
463
|
+
def test_display_prereqs
|
464
|
+
ran = false
|
465
|
+
setup_command_line('-f', '-s', '--prereqs', '--rakelib=""')
|
466
|
+
@app.last_description = "COMMENT"
|
467
|
+
t = @app.define_task(Rake::Task, "default")
|
468
|
+
t.enhance([:a, :b])
|
469
|
+
@app.define_task(Rake::Task, "a")
|
470
|
+
@app.define_task(Rake::Task, "b")
|
471
|
+
out, = capture_io { @app.run }
|
472
|
+
assert @app.options.show_prereqs
|
473
|
+
assert ! ran
|
474
|
+
assert_match(/rake a$/, out)
|
475
|
+
assert_match(/rake b$/, out)
|
476
|
+
assert_match(/rake default\n( *(a|b)\n){2}/m, out)
|
477
|
+
end
|
478
|
+
|
479
|
+
def test_bad_run
|
480
|
+
@app.intern(Rake::Task, "default").enhance { fail }
|
481
|
+
setup_command_line('-f', '-s', '--rakelib=""')
|
482
|
+
_, err = capture_io {
|
483
|
+
assert_raises(SystemExit){ @app.run }
|
484
|
+
}
|
485
|
+
assert_match(/see full trace/i, err)
|
486
|
+
ensure
|
487
|
+
ARGV.clear
|
488
|
+
end
|
489
|
+
|
490
|
+
def test_bad_run_with_trace
|
491
|
+
@app.intern(Rake::Task, "default").enhance { fail }
|
492
|
+
setup_command_line('-f', '-s', '-t')
|
493
|
+
_, err = capture_io {
|
494
|
+
assert_raises(SystemExit) { @app.run }
|
495
|
+
}
|
496
|
+
refute_match(/see full trace/i, err)
|
497
|
+
ensure
|
498
|
+
ARGV.clear
|
499
|
+
end
|
500
|
+
|
501
|
+
def test_bad_run_with_backtrace
|
502
|
+
@app.intern(Rake::Task, "default").enhance { fail }
|
503
|
+
setup_command_line('-f', '-s', '--backtrace')
|
504
|
+
_, err = capture_io {
|
505
|
+
assert_raises(SystemExit) {
|
506
|
+
@app.run
|
507
|
+
}
|
508
|
+
}
|
509
|
+
refute_match(/see full trace/, err)
|
510
|
+
ensure
|
511
|
+
ARGV.clear
|
512
|
+
end
|
513
|
+
|
514
|
+
CustomError = Class.new(RuntimeError)
|
515
|
+
|
516
|
+
def test_bad_run_includes_exception_name
|
517
|
+
@app.intern(Rake::Task, "default").enhance {
|
518
|
+
raise CustomError, "intentional"
|
519
|
+
}
|
520
|
+
setup_command_line('-f', '-s')
|
521
|
+
_, err = capture_io {
|
522
|
+
assert_raises(SystemExit) {
|
523
|
+
@app.run
|
524
|
+
}
|
525
|
+
}
|
526
|
+
assert_match(/CustomError: intentional/, err)
|
527
|
+
end
|
528
|
+
|
529
|
+
def test_rake_error_excludes_exception_name
|
530
|
+
@app.intern(Rake::Task, "default").enhance {
|
531
|
+
fail "intentional"
|
532
|
+
}
|
533
|
+
setup_command_line('-f', '-s')
|
534
|
+
_, err = capture_io {
|
535
|
+
assert_raises(SystemExit) {
|
536
|
+
@app.run
|
537
|
+
}
|
538
|
+
}
|
539
|
+
refute_match(/RuntimeError/, err)
|
540
|
+
assert_match(/intentional/, err)
|
541
|
+
end
|
542
|
+
|
543
|
+
def cause_supported?
|
544
|
+
ex = StandardError.new
|
545
|
+
ex.respond_to?(:cause)
|
546
|
+
end
|
547
|
+
|
548
|
+
def test_printing_original_exception_cause
|
549
|
+
custom_error = Class.new(StandardError)
|
550
|
+
@app.intern(Rake::Task, "default").enhance {
|
551
|
+
begin
|
552
|
+
raise custom_error, "Original Error"
|
553
|
+
rescue custom_error
|
554
|
+
raise custom_error, "Secondary Error"
|
555
|
+
end
|
556
|
+
}
|
557
|
+
setup_command_line('-f', '-s')
|
558
|
+
_ ,err = capture_io {
|
559
|
+
assert_raises(SystemExit) {
|
560
|
+
@app.run
|
561
|
+
}
|
562
|
+
}
|
563
|
+
if cause_supported?
|
564
|
+
assert_match(/Original Error/, err)
|
565
|
+
end
|
566
|
+
assert_match(/Secondary Error/, err)
|
567
|
+
ensure
|
568
|
+
ARGV.clear
|
569
|
+
end
|
570
|
+
|
571
|
+
def test_run_with_bad_options
|
572
|
+
@app.intern(Rake::Task, "default").enhance { fail }
|
573
|
+
setup_command_line('-f', '-s', '--xyzzy')
|
574
|
+
assert_raises(SystemExit) {
|
575
|
+
capture_io { @app.run }
|
576
|
+
}
|
577
|
+
ensure
|
578
|
+
ARGV.clear
|
579
|
+
end
|
580
|
+
|
581
|
+
def test_standard_exception_handling_invalid_option
|
582
|
+
out, err = capture_io do
|
583
|
+
e = assert_raises SystemExit do
|
584
|
+
@app.standard_exception_handling do
|
585
|
+
raise OptionParser::InvalidOption, 'blah'
|
586
|
+
end
|
587
|
+
end
|
588
|
+
|
589
|
+
assert_equal 1, e.status
|
590
|
+
end
|
591
|
+
|
592
|
+
assert_empty out
|
593
|
+
assert_equal "invalid option: blah\n", err
|
594
|
+
end
|
595
|
+
|
596
|
+
def test_standard_exception_handling_other
|
597
|
+
out, err = capture_io do
|
598
|
+
e = assert_raises SystemExit do
|
599
|
+
@app.standard_exception_handling do
|
600
|
+
raise 'blah'
|
601
|
+
end
|
602
|
+
end
|
603
|
+
|
604
|
+
assert_equal 1, e.status
|
605
|
+
end
|
606
|
+
|
607
|
+
assert_empty out
|
608
|
+
assert_match "rake aborted!\n", err
|
609
|
+
assert_match "blah\n", err
|
610
|
+
end
|
611
|
+
|
612
|
+
def test_standard_exception_handling_system_exit
|
613
|
+
out, err = capture_io do
|
614
|
+
e = assert_raises SystemExit do
|
615
|
+
@app.standard_exception_handling do
|
616
|
+
exit 0
|
617
|
+
end
|
618
|
+
end
|
619
|
+
|
620
|
+
assert_equal 0, e.status
|
621
|
+
end
|
622
|
+
|
623
|
+
assert_empty out
|
624
|
+
assert_empty err
|
625
|
+
end
|
626
|
+
|
627
|
+
def test_standard_exception_handling_system_exit_nonzero
|
628
|
+
out, err = capture_io do
|
629
|
+
e = assert_raises SystemExit do
|
630
|
+
@app.standard_exception_handling do
|
631
|
+
exit 5
|
632
|
+
end
|
633
|
+
end
|
634
|
+
|
635
|
+
assert_equal 5, e.status
|
636
|
+
end
|
637
|
+
|
638
|
+
assert_empty out
|
639
|
+
assert_empty err
|
640
|
+
end
|
641
|
+
|
642
|
+
def util_loader
|
643
|
+
loader = Object.new
|
644
|
+
|
645
|
+
loader.instance_variable_set :@load_called, false
|
646
|
+
def loader.load arg
|
647
|
+
raise ArgumentError, arg unless arg == 'x.dummy'
|
648
|
+
@load_called = true
|
649
|
+
end
|
650
|
+
|
651
|
+
loader.instance_variable_set :@make_dummy_called, false
|
652
|
+
def loader.make_dummy
|
653
|
+
@make_dummy_called = true
|
654
|
+
end
|
655
|
+
|
656
|
+
loader
|
657
|
+
end
|
658
|
+
|
659
|
+
end
|