win32-api 1.6.0-universal-mingw32 → 1.6.1.beta1-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 +4 -0
- data/Gemfile.lock +5 -5
- data/Rakefile +45 -19
- data/appveyor.yml +12 -0
- data/appveyor/build.cmd +3 -0
- data/lib/win32/api.rb +8 -0
- 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/ruby24_32/win32/api.so +0 -0
- data/lib/win32/ruby24_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/win32-api.gemspec +1 -1
- metadata +8 -341
- data/vendor/bundle/ruby/2.2.0/bin/devkit +0 -23
- data/vendor/bundle/ruby/2.2.0/bin/devkit.bat +0 -6
- data/vendor/bundle/ruby/2.2.0/bin/rake +0 -23
- data/vendor/bundle/ruby/2.2.0/bin/rake.bat +0 -6
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/CHANGELOG +0 -55
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/LICENSE +0 -339
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/README.md +0 -73
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/Rakefile +0 -8
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/colorize.gemspec +0 -35
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize.rb +0 -12
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize/class_methods.rb +0 -116
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize/instance_methods.rb +0 -135
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/test/test_colorize.rb +0 -161
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Gemfile +0 -4
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/README.md +0 -34
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Rakefile +0 -1
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Rspec-example-matchers.txt +0 -184
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/bin/devkit +0 -87
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/devkit.gemspec +0 -27
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit.rb +0 -18
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/core.rb +0 -53
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/identity.rb +0 -78
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/ssh_identity.rb +0 -53
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/version.rb +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/core_spec.rb +0 -46
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/identity_spec.rb +0 -1
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/ssh_identity_spec.rb +0 -1
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit_spec.rb +0 -5
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/spec_helper.rb +0 -8
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/AUTHORS +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/COPYING +0 -339
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Changelog.md +0 -415
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Gemfile +0 -9
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/INSTALL +0 -59
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/LICENSE +0 -7
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/README.rdoc +0 -74
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Rakefile +0 -30
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/TODO +0 -6
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/ansi_colors.rb +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/asking_for_arrays.rb +0 -18
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/basic_usage.rb +0 -75
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/color_scheme.rb +0 -32
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/get_character.rb +0 -12
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/limit.rb +0 -12
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/menus.rb +0 -65
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/overwrite.rb +0 -19
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/page_and_wrap.rb +0 -322
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/password.rb +0 -7
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/repeat_entry.rb +0 -21
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/trapping_eof.rb +0 -22
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/using_readline.rb +0 -17
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/highline.gemspec +0 -37
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline.rb +0 -1048
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/color_scheme.rb +0 -134
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/compatibility.rb +0 -16
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/import.rb +0 -41
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/menu.rb +0 -381
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/question.rb +0 -480
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/simulate.rb +0 -48
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/style.rb +0 -192
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/version.rb +0 -4
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/setup.rb +0 -1360
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/site/highline.css +0 -65
- 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 +0 -58
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/string_methods.rb +0 -32
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_color_scheme.rb +0 -96
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_highline.rb +0 -1402
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_import.rb +0 -52
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_menu.rb +0 -439
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_simulator.rb +0 -23
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_string_highline.rb +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_style.rb +0 -578
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/BSDL +0 -22
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/COPYING +0 -57
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/Gemfile +0 -9
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/LEGAL +0 -4
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/README.rdoc +0 -19
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/Rakefile +0 -16
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/benchmarks/bm_yhpg.rb +0 -59
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/benchmarks/helper.rb +0 -8
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert.rb +0 -338
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert/enable_tracepoint_events.rb +0 -82
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert/version.rb +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/power_assert.gemspec +0 -23
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/test/helper.rb +0 -10
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/test/test_power_assert.rb +0 -512
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/CONTRIBUTING.rdoc +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/History.rdoc +0 -719
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/MIT-LICENSE +0 -21
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/Manifest.txt +0 -154
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/README.rdoc +0 -157
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/Rakefile +0 -82
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/bin/rake +0 -33
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/command_line_usage.rdoc +0 -158
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/Rakefile1 +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/Rakefile2 +0 -35
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/a.c +0 -6
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/b.c +0 -6
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/main.c +0 -11
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/glossary.rdoc +0 -42
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/jamis.rb +0 -591
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/proto_rake.rdoc +0 -127
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rake.1 +0 -141
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rakefile.rdoc +0 -624
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rational.rdoc +0 -151
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.4.14.rdoc +0 -23
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.4.15.rdoc +0 -35
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.0.rdoc +0 -53
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.3.rdoc +0 -78
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.4.rdoc +0 -46
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.6.0.rdoc +0 -141
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.0.rdoc +0 -119
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.1.rdoc +0 -59
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.2.rdoc +0 -121
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.3.rdoc +0 -47
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.0.rdoc +0 -114
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.2.rdoc +0 -165
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.3.rdoc +0 -112
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.4.rdoc +0 -147
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.5.rdoc +0 -53
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.6.rdoc +0 -37
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.7.rdoc +0 -55
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.0.rdoc +0 -112
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.1.rdoc +0 -52
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.2.rdoc +0 -49
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.3.rdoc +0 -102
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.4.rdoc +0 -60
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.5.rdoc +0 -55
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.6.rdoc +0 -64
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.0.rdoc +0 -178
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.1.rdoc +0 -58
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.2.rdoc +0 -53
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.3.rdoc +0 -191
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.1.0.rdoc +0 -61
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake.rb +0 -73
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb +0 -787
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/backtrace.rb +0 -23
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/clean.rb +0 -76
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/cloneable.rb +0 -16
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/compositepublisher.rb +0 -21
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/ftptools.rb +0 -137
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/sshpublisher.rb +0 -60
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/cpu_counter.rb +0 -120
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/default_loader.rb +0 -14
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/dsl_definition.rb +0 -194
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/early_time.rb +0 -21
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_creation_task.rb +0 -24
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_list.rb +0 -436
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_task.rb +0 -46
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_utils.rb +0 -123
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/invocation_chain.rb +0 -56
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/invocation_exception_mixin.rb +0 -16
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/late_time.rb +0 -17
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/linked_list.rb +0 -111
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/loaders/makefile.rb +0 -53
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/multi_task.rb +0 -13
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/name_space.rb +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/packagetask.rb +0 -199
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/phony.rb +0 -15
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/private_reader.rb +0 -20
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/promise.rb +0 -99
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/pseudo_status.rb +0 -29
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_test_loader.rb +0 -22
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rule_recursion_overflow_error.rb +0 -20
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/scope.rb +0 -42
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task.rb +0 -391
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_argument_error.rb +0 -7
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_arguments.rb +0 -102
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_manager.rb +0 -316
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/tasklib.rb +0 -11
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/testtask.rb +0 -204
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/thread_history_display.rb +0 -48
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/thread_pool.rb +0 -163
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/trace_output.rb +0 -22
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/version.rb +0 -7
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/win32.rb +0 -50
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/rakelib/test_times.rake +0 -25
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/file_creation.rb +0 -34
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/helper.rb +0 -134
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/support/rakefile_definitions.rb +0 -476
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/support/ruby_runner.rb +0 -34
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_private_reader.rb +0 -42
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake.rb +0 -40
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_application.rb +0 -659
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_application_options.rb +0 -468
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_backtrace.rb +0 -119
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_clean.rb +0 -61
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_cpu_counter.rb +0 -68
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_definitions.rb +0 -84
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_directory_task.rb +0 -76
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_dsl.rb +0 -40
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_early_time.rb +0 -31
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_creation_task.rb +0 -56
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_list.rb +0 -687
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_list_path_map.rb +0 -15
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_task.rb +0 -197
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_utils.rb +0 -318
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_ftp_file.rb +0 -74
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_functional.rb +0 -484
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_invocation_chain.rb +0 -64
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_late_time.rb +0 -18
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_linked_list.rb +0 -84
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_makefile_loader.rb +0 -46
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_multi_task.rb +0 -64
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_name_space.rb +0 -57
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_package_task.rb +0 -79
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map.rb +0 -168
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map_explode.rb +0 -34
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map_partial.rb +0 -18
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_pseudo_status.rb +0 -21
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_rake_test_loader.rb +0 -20
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_reduce_compat.rb +0 -26
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_require.rb +0 -40
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_rules.rb +0 -388
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_scope.rb +0 -44
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task.rb +0 -430
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_argument_parsing.rb +0 -119
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_arguments.rb +0 -134
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_manager.rb +0 -178
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_manager_argument_resolution.rb +0 -19
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_with_arguments.rb +0 -172
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_test_task.rb +0 -130
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_thread_pool.rb +0 -145
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_top_level_functions.rb +0 -71
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_win32.rb +0 -72
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_thread_history_display.rb +0 -101
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_trace_output.rb +0 -52
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/COPYING +0 -64
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/GPL +0 -339
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/LGPL +0 -502
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/PSFL +0 -271
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/README.md +0 -101
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/Rakefile +0 -71
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test-unit.rb +0 -34
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit.rb +0 -505
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/assertion-failed-error.rb +0 -25
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/assertions.rb +0 -2218
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/attribute-matcher.rb +0 -26
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/attribute.rb +0 -158
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/auto-runner-loader.rb +0 -17
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/autorunner.rb +0 -536
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/code-snippet-fetcher.rb +0 -58
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector.rb +0 -73
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/descendant.rb +0 -19
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/dir.rb +0 -108
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/load.rb +0 -202
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/objectspace.rb +0 -34
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/xml.rb +0 -249
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/color-scheme.rb +0 -198
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/color.rb +0 -134
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/data.rb +0 -262
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/diff.rb +0 -746
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/error.rb +0 -158
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/exception-handler.rb +0 -82
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/failure.rb +0 -169
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/fault-location-detector.rb +0 -100
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/fixture.rb +0 -295
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/notification.rb +0 -136
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/omission.rb +0 -195
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/pending.rb +0 -154
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/priority.rb +0 -192
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/console.rb +0 -59
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/emacs.rb +0 -8
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/xml.rb +0 -15
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/test-suite-creator.rb +0 -89
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testcase.rb +0 -811
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testresult.rb +0 -132
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testsuite.rb +0 -175
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/console/outputlevel.rb +0 -15
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/console/testrunner.rb +0 -693
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/emacs/testrunner.rb +0 -49
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunner.rb +0 -53
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunnermediator.rb +0 -114
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunnerutilities.rb +0 -41
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/xml/testrunner.rb +0 -224
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/backtracefilter.rb +0 -59
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/method-owner-finder.rb +0 -28
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/observable.rb +0 -90
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/output.rb +0 -31
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/procwrapper.rb +0 -48
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/version.rb +0 -5
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/adder.rb +0 -13
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/subtracter.rb +0 -12
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_adder.rb +0 -20
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_subtracter.rb +0 -20
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_user.rb +0 -23
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test-descendant.rb +0 -178
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test-load.rb +0 -442
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test_dir.rb +0 -406
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test_objectspace.rb +0 -100
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header-label.csv +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header-label.tsv +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header.csv +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header.tsv +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/no-header.csv +0 -2
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/no-header.tsv +0 -2
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/plus.csv +0 -3
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/run-test.rb +0 -22
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-assertions.rb +0 -2160
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-attribute-matcher.rb +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-attribute.rb +0 -123
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-code-snippet.rb +0 -37
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-color-scheme.rb +0 -82
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-color.rb +0 -47
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-data.rb +0 -303
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-diff.rb +0 -518
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-emacs-runner.rb +0 -60
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-error.rb +0 -26
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-failure.rb +0 -33
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-fault-location-detector.rb +0 -163
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-fixture.rb +0 -713
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-notification.rb +0 -33
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-omission.rb +0 -81
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-pending.rb +0 -70
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-priority.rb +0 -173
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-case.rb +0 -1171
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-result.rb +0 -113
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-suite-creator.rb +0 -97
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-suite.rb +0 -150
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/testunit-test-util.rb +0 -31
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/ui/test_testrunmediator.rb +0 -20
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test-method-owner-finder.rb +0 -38
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test-output.rb +0 -11
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_backtracefilter.rb +0 -52
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_observable.rb +0 -102
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_procwrapper.rb +0 -36
- data/vendor/bundle/ruby/2.2.0/specifications/colorize-0.7.7.gemspec +0 -38
- data/vendor/bundle/ruby/2.2.0/specifications/devkit-0.1.0.gemspec +0 -46
- data/vendor/bundle/ruby/2.2.0/specifications/highline-1.7.8.gemspec +0 -37
- data/vendor/bundle/ruby/2.2.0/specifications/power_assert-0.3.0.gemspec +0 -41
- data/vendor/bundle/ruby/2.2.0/specifications/rake-11.1.2.gemspec +0 -43
- data/vendor/bundle/ruby/2.2.0/specifications/test-unit-3.1.9.gemspec +0 -47
@@ -1,132 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Author:: Nathaniel Talbott.
|
3
|
-
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
4
|
-
# License:: Ruby license.
|
5
|
-
|
6
|
-
require 'test/unit/util/observable'
|
7
|
-
require 'test/unit/failure'
|
8
|
-
require 'test/unit/error'
|
9
|
-
require 'test/unit/omission'
|
10
|
-
require 'test/unit/pending'
|
11
|
-
require 'test/unit/notification'
|
12
|
-
|
13
|
-
module Test
|
14
|
-
module Unit
|
15
|
-
module NullResultContainerInitializer
|
16
|
-
private
|
17
|
-
def initialize_containers
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# Collects Test::Unit::Failure and Test::Unit::Error so that
|
22
|
-
# they can be displayed to the user. To this end, observers
|
23
|
-
# can be added to it, allowing the dynamic updating of, say, a
|
24
|
-
# UI.
|
25
|
-
class TestResult
|
26
|
-
include Util::Observable
|
27
|
-
include NullResultContainerInitializer
|
28
|
-
include TestResultFailureSupport
|
29
|
-
include TestResultErrorSupport
|
30
|
-
include TestResultPendingSupport
|
31
|
-
include TestResultOmissionSupport
|
32
|
-
include TestResultNotificationSupport
|
33
|
-
|
34
|
-
FINISHED = name + "::FINISHED"
|
35
|
-
CHANGED = name + "::CHANGED"
|
36
|
-
PASS_ASSERTION = name + "::PASS_ASSERTION"
|
37
|
-
FAULT = name + "::FAULT"
|
38
|
-
|
39
|
-
attr_reader :run_count, :pass_count, :assertion_count, :faults
|
40
|
-
|
41
|
-
attr_accessor :stop_tag
|
42
|
-
|
43
|
-
# Constructs a new, empty TestResult.
|
44
|
-
def initialize
|
45
|
-
@run_count, @pass_count, @assertion_count = 0, 0, 0
|
46
|
-
@summary_generators = []
|
47
|
-
@problem_checkers = []
|
48
|
-
@faults = []
|
49
|
-
@stop_tag = nil
|
50
|
-
initialize_containers
|
51
|
-
end
|
52
|
-
|
53
|
-
# Records a test run.
|
54
|
-
def add_run
|
55
|
-
@run_count += 1
|
56
|
-
notify_listeners(FINISHED, self)
|
57
|
-
notify_changed
|
58
|
-
end
|
59
|
-
|
60
|
-
def add_pass
|
61
|
-
@pass_count += 1
|
62
|
-
end
|
63
|
-
|
64
|
-
# Records an individual assertion.
|
65
|
-
def add_assertion
|
66
|
-
@assertion_count += 1
|
67
|
-
notify_listeners(PASS_ASSERTION, self)
|
68
|
-
notify_changed
|
69
|
-
end
|
70
|
-
|
71
|
-
# Returns a string contain the recorded runs, assertions,
|
72
|
-
# failures and errors in this TestResult.
|
73
|
-
def summary
|
74
|
-
["#{run_count} tests",
|
75
|
-
"#{assertion_count} assertions",
|
76
|
-
*@summary_generators.collect {|generator| __send__(generator)}].join(", ")
|
77
|
-
end
|
78
|
-
|
79
|
-
# Returnes a string that shows result status.
|
80
|
-
def status
|
81
|
-
if passed?
|
82
|
-
if pending_count > 0
|
83
|
-
"pending"
|
84
|
-
elsif omission_count > 0
|
85
|
-
"omission"
|
86
|
-
elsif notification_count > 0
|
87
|
-
"notification"
|
88
|
-
else
|
89
|
-
"pass"
|
90
|
-
end
|
91
|
-
elsif error_count > 0
|
92
|
-
"error"
|
93
|
-
elsif failure_count > 0
|
94
|
-
"failure"
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
def stop
|
99
|
-
throw @stop_tag
|
100
|
-
end
|
101
|
-
|
102
|
-
def to_s
|
103
|
-
summary
|
104
|
-
end
|
105
|
-
|
106
|
-
# Returns whether or not this TestResult represents
|
107
|
-
# successful completion.
|
108
|
-
def passed?
|
109
|
-
@problem_checkers.all? {|checker| not __send__(checker)}
|
110
|
-
end
|
111
|
-
|
112
|
-
def pass_percentage
|
113
|
-
n_tests = @run_count - omission_count
|
114
|
-
if n_tests.zero?
|
115
|
-
0
|
116
|
-
else
|
117
|
-
100.0 * (@pass_count / n_tests.to_f)
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
private
|
122
|
-
def notify_changed
|
123
|
-
notify_listeners(CHANGED, self)
|
124
|
-
end
|
125
|
-
|
126
|
-
def notify_fault(fault)
|
127
|
-
@faults << fault
|
128
|
-
notify_listeners(FAULT, fault)
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
@@ -1,175 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
#
|
3
|
-
# Author:: Nathaniel Talbott.
|
4
|
-
# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
|
5
|
-
# Copyright:: Copyright (c) 2008-2011 Kouhei Sutou. All rights reserved.
|
6
|
-
# License:: Ruby license.
|
7
|
-
|
8
|
-
require 'test/unit/error'
|
9
|
-
|
10
|
-
module Test
|
11
|
-
module Unit
|
12
|
-
|
13
|
-
# A collection of tests which can be #run.
|
14
|
-
#
|
15
|
-
# Note: It is easy to confuse a TestSuite instance with
|
16
|
-
# something that has a static suite method; I know because _I_
|
17
|
-
# have trouble keeping them straight. Think of something that
|
18
|
-
# has a suite method as simply providing a way to get a
|
19
|
-
# meaningful TestSuite instance.
|
20
|
-
class TestSuite
|
21
|
-
attr_reader :name, :tests, :test_case, :start_time, :elapsed_time
|
22
|
-
|
23
|
-
# Test suite that has higher priority is ran prior to
|
24
|
-
# test suites that have lower priority.
|
25
|
-
attr_accessor :priority
|
26
|
-
|
27
|
-
STARTED = name + "::STARTED"
|
28
|
-
STARTED_OBJECT = name + "::STARTED::OBJECT"
|
29
|
-
FINISHED = name + "::FINISHED"
|
30
|
-
FINISHED_OBJECT = name + "::FINISHED::OBJECT"
|
31
|
-
|
32
|
-
# Creates a new TestSuite with the given name.
|
33
|
-
def initialize(name="Unnamed TestSuite", test_case=nil)
|
34
|
-
@name = name
|
35
|
-
@tests = []
|
36
|
-
@test_case = test_case
|
37
|
-
@n_tests = 0
|
38
|
-
@priority = 0
|
39
|
-
@start_time = nil
|
40
|
-
@elapsed_time = nil
|
41
|
-
@passed = true
|
42
|
-
end
|
43
|
-
|
44
|
-
# Runs the tests and/or suites contained in this
|
45
|
-
# TestSuite.
|
46
|
-
def run(result, &progress_block)
|
47
|
-
@start_time = Time.now
|
48
|
-
yield(STARTED, name)
|
49
|
-
yield(STARTED_OBJECT, self)
|
50
|
-
run_startup(result)
|
51
|
-
while test = @tests.shift
|
52
|
-
@n_tests += test.size
|
53
|
-
run_test(test, result, &progress_block)
|
54
|
-
@passed = false unless test.passed?
|
55
|
-
end
|
56
|
-
ensure
|
57
|
-
begin
|
58
|
-
run_shutdown(result)
|
59
|
-
ensure
|
60
|
-
@elapsed_time = Time.now - @start_time
|
61
|
-
yield(FINISHED, name)
|
62
|
-
yield(FINISHED_OBJECT, self)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Adds the test to the suite.
|
67
|
-
def <<(test)
|
68
|
-
@tests << test
|
69
|
-
self
|
70
|
-
end
|
71
|
-
|
72
|
-
def delete(test)
|
73
|
-
@tests.delete(test)
|
74
|
-
end
|
75
|
-
|
76
|
-
def delete_tests(tests)
|
77
|
-
@tests -= tests
|
78
|
-
end
|
79
|
-
|
80
|
-
# Retuns the rolled up number of tests in this suite;
|
81
|
-
# i.e. if the suite contains other suites, it counts the
|
82
|
-
# tests within those suites, not the suites themselves.
|
83
|
-
def size
|
84
|
-
total_size = @n_tests
|
85
|
-
@tests.each { |test| total_size += test.size }
|
86
|
-
total_size
|
87
|
-
end
|
88
|
-
|
89
|
-
def empty?
|
90
|
-
size.zero?
|
91
|
-
end
|
92
|
-
|
93
|
-
# Overridden to return the name given the suite at
|
94
|
-
# creation.
|
95
|
-
def to_s
|
96
|
-
@name
|
97
|
-
end
|
98
|
-
|
99
|
-
# It's handy to be able to compare TestSuite instances.
|
100
|
-
def ==(other)
|
101
|
-
return false unless(other.kind_of?(self.class))
|
102
|
-
return false unless(@name == other.name)
|
103
|
-
@tests == other.tests
|
104
|
-
end
|
105
|
-
|
106
|
-
def passed?
|
107
|
-
@passed
|
108
|
-
end
|
109
|
-
|
110
|
-
private
|
111
|
-
def run_startup(result)
|
112
|
-
return if @test_case.nil? or !@test_case.respond_to?(:startup)
|
113
|
-
begin
|
114
|
-
@test_case.startup
|
115
|
-
rescue Exception
|
116
|
-
raise unless handle_exception($!, result)
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
def run_test(test, result)
|
121
|
-
finished_is_yielded = false
|
122
|
-
finished_object_is_yielded = false
|
123
|
-
previous_event_name = nil
|
124
|
-
test.run(result) do |event_name, *args|
|
125
|
-
case previous_event_name
|
126
|
-
when Test::Unit::TestCase::STARTED
|
127
|
-
if event_name != Test::Unit::TestCase::STARTED_OBJECT
|
128
|
-
yield(Test::Unit::TestCase::STARTED_OBJECT, test)
|
129
|
-
end
|
130
|
-
when Test::Unit::TestCase::FINISHED
|
131
|
-
if event_name != Test::Unit::TestCase::FINISHED_OBJECT
|
132
|
-
yield(Test::Unit::TestCase::FINISHED_OBJECT, test)
|
133
|
-
end
|
134
|
-
finished_object_is_yielded = true
|
135
|
-
end
|
136
|
-
|
137
|
-
case event_name
|
138
|
-
when Test::Unit::TestCase::STARTED
|
139
|
-
finished_is_yielded = false
|
140
|
-
finished_object_is_yielded = false
|
141
|
-
when Test::Unit::TestCase::FINISHED
|
142
|
-
finished_is_yielded = true
|
143
|
-
end
|
144
|
-
|
145
|
-
previous_event_name = event_name
|
146
|
-
yield(event_name, *args)
|
147
|
-
end
|
148
|
-
|
149
|
-
if finished_is_yielded and not finished_object_is_yielded
|
150
|
-
yield(Test::Unit::TestCase::FINISHED_OBJECT, test)
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
def run_shutdown(result)
|
155
|
-
return if @test_case.nil? or !@test_case.respond_to?(:shutdown)
|
156
|
-
begin
|
157
|
-
@test_case.shutdown
|
158
|
-
rescue Exception
|
159
|
-
raise unless handle_exception($!, result)
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
def handle_exception(exception, result)
|
164
|
-
case exception
|
165
|
-
when *ErrorHandler::PASS_THROUGH_EXCEPTIONS
|
166
|
-
false
|
167
|
-
else
|
168
|
-
result.add_error(Error.new(@test_case.name, exception))
|
169
|
-
@passed = false
|
170
|
-
true
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
@@ -1,693 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
#
|
3
|
-
# Author:: Nathaniel Talbott.
|
4
|
-
# Copyright::
|
5
|
-
# * Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
|
6
|
-
# * Copyright (c) 2008-2013 Kouhei Sutou <kou@clear-code.com>
|
7
|
-
# License:: Ruby license.
|
8
|
-
|
9
|
-
begin
|
10
|
-
require 'io/console'
|
11
|
-
rescue LoadError
|
12
|
-
end
|
13
|
-
|
14
|
-
require 'test/unit/color-scheme'
|
15
|
-
require 'test/unit/code-snippet-fetcher'
|
16
|
-
require 'test/unit/fault-location-detector'
|
17
|
-
require 'test/unit/diff'
|
18
|
-
require 'test/unit/ui/testrunner'
|
19
|
-
require 'test/unit/ui/testrunnermediator'
|
20
|
-
require 'test/unit/ui/console/outputlevel'
|
21
|
-
|
22
|
-
module Test
|
23
|
-
module Unit
|
24
|
-
module UI
|
25
|
-
module Console
|
26
|
-
|
27
|
-
# Runs a Test::Unit::TestSuite on the console.
|
28
|
-
class TestRunner < UI::TestRunner
|
29
|
-
include OutputLevel
|
30
|
-
|
31
|
-
# Creates a new TestRunner for running the passed
|
32
|
-
# suite. If quiet_mode is true, the output while
|
33
|
-
# running is limited to progress dots, errors and
|
34
|
-
# failures, and the final result. io specifies
|
35
|
-
# where runner output should go to; defaults to
|
36
|
-
# STDOUT.
|
37
|
-
def initialize(suite, options={})
|
38
|
-
super
|
39
|
-
@output_level = @options[:output_level] || NORMAL
|
40
|
-
@output = @options[:output] || STDOUT
|
41
|
-
@use_color = @options[:use_color]
|
42
|
-
@use_color = guess_color_availability if @use_color.nil?
|
43
|
-
@color_scheme = @options[:color_scheme] || ColorScheme.default
|
44
|
-
@reset_color = Color.new("reset")
|
45
|
-
@progress_row = 0
|
46
|
-
@progress_row_max = @options[:progress_row_max]
|
47
|
-
@progress_row_max ||= guess_progress_row_max
|
48
|
-
@show_detail_immediately = @options[:show_detail_immediately]
|
49
|
-
@show_detail_immediately = true if @show_detail_immediately.nil?
|
50
|
-
@already_outputted = false
|
51
|
-
@indent = 0
|
52
|
-
@top_level = true
|
53
|
-
@current_output_level = NORMAL
|
54
|
-
@faults = []
|
55
|
-
@code_snippet_fetcher = CodeSnippetFetcher.new
|
56
|
-
@test_suites = []
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
def change_output_level(level)
|
61
|
-
old_output_level = @current_output_level
|
62
|
-
@current_output_level = level
|
63
|
-
yield
|
64
|
-
@current_output_level = old_output_level
|
65
|
-
end
|
66
|
-
|
67
|
-
def setup_mediator
|
68
|
-
super
|
69
|
-
output_setup_end
|
70
|
-
end
|
71
|
-
|
72
|
-
def output_setup_end
|
73
|
-
suite_name = @suite.to_s
|
74
|
-
suite_name = @suite.name if @suite.kind_of?(Module)
|
75
|
-
output("Loaded suite #{suite_name}")
|
76
|
-
end
|
77
|
-
|
78
|
-
def attach_to_mediator
|
79
|
-
@mediator.add_listener(TestResult::FAULT,
|
80
|
-
&method(:add_fault))
|
81
|
-
@mediator.add_listener(TestRunnerMediator::STARTED,
|
82
|
-
&method(:started))
|
83
|
-
@mediator.add_listener(TestRunnerMediator::FINISHED,
|
84
|
-
&method(:finished))
|
85
|
-
@mediator.add_listener(TestCase::STARTED_OBJECT,
|
86
|
-
&method(:test_started))
|
87
|
-
@mediator.add_listener(TestCase::FINISHED_OBJECT,
|
88
|
-
&method(:test_finished))
|
89
|
-
@mediator.add_listener(TestSuite::STARTED_OBJECT,
|
90
|
-
&method(:test_suite_started))
|
91
|
-
@mediator.add_listener(TestSuite::FINISHED_OBJECT,
|
92
|
-
&method(:test_suite_finished))
|
93
|
-
end
|
94
|
-
|
95
|
-
def add_fault(fault)
|
96
|
-
@faults << fault
|
97
|
-
output_progress(fault.single_character_display,
|
98
|
-
fault_marker_color(fault))
|
99
|
-
output_progress_in_detail(fault) if @show_detail_immediately
|
100
|
-
@already_outputted = true if fault.critical?
|
101
|
-
end
|
102
|
-
|
103
|
-
def started(result)
|
104
|
-
@result = result
|
105
|
-
output_started
|
106
|
-
end
|
107
|
-
|
108
|
-
def output_started
|
109
|
-
output("Started")
|
110
|
-
end
|
111
|
-
|
112
|
-
def finished(elapsed_time)
|
113
|
-
nl if output?(NORMAL) and !output?(VERBOSE)
|
114
|
-
output_faults unless @show_detail_immediately
|
115
|
-
nl(PROGRESS_ONLY)
|
116
|
-
change_output_level(IMPORTANT_FAULTS_ONLY) do
|
117
|
-
output_statistics(elapsed_time)
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
def output_faults
|
122
|
-
categorized_faults = categorize_faults
|
123
|
-
change_output_level(IMPORTANT_FAULTS_ONLY) do
|
124
|
-
output_faults_in_detail(categorized_faults[:need_detail_faults])
|
125
|
-
end
|
126
|
-
output_faults_in_short("Omissions", Omission,
|
127
|
-
categorized_faults[:omissions])
|
128
|
-
output_faults_in_short("Notifications", Notification,
|
129
|
-
categorized_faults[:notifications])
|
130
|
-
end
|
131
|
-
|
132
|
-
def max_digit(max_number)
|
133
|
-
(Math.log10(max_number) + 1).truncate
|
134
|
-
end
|
135
|
-
|
136
|
-
def output_faults_in_detail(faults)
|
137
|
-
return if faults.nil?
|
138
|
-
digit = max_digit(faults.size)
|
139
|
-
faults.each_with_index do |fault, index|
|
140
|
-
nl
|
141
|
-
output_single("%#{digit}d) " % (index + 1))
|
142
|
-
output_fault_in_detail(fault)
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
def output_faults_in_short(label, fault_class, faults)
|
147
|
-
return if faults.nil?
|
148
|
-
digit = max_digit(faults.size)
|
149
|
-
nl
|
150
|
-
output_single(label, fault_class_color(fault_class))
|
151
|
-
output(":")
|
152
|
-
faults.each_with_index do |fault, index|
|
153
|
-
output_single("%#{digit}d) " % (index + 1))
|
154
|
-
output_fault_in_short(fault)
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
def categorize_faults
|
159
|
-
faults = {}
|
160
|
-
@faults.each do |fault|
|
161
|
-
category = categorize_fault(fault)
|
162
|
-
faults[category] ||= []
|
163
|
-
faults[category] << fault
|
164
|
-
end
|
165
|
-
faults
|
166
|
-
end
|
167
|
-
|
168
|
-
def categorize_fault(fault)
|
169
|
-
case fault
|
170
|
-
when Omission
|
171
|
-
:omissions
|
172
|
-
when Notification
|
173
|
-
:notifications
|
174
|
-
else
|
175
|
-
:need_detail_faults
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
def output_fault_in_detail(fault)
|
180
|
-
if fault.is_a?(Failure) and
|
181
|
-
fault.inspected_expected and fault.inspected_actual
|
182
|
-
output_single("#{fault.label}: ")
|
183
|
-
output(fault.test_name, fault_color(fault))
|
184
|
-
output_fault_backtrace(fault)
|
185
|
-
output_failure_message(fault)
|
186
|
-
else
|
187
|
-
if fault.is_a?(Error)
|
188
|
-
output_single("#{fault.label}: ")
|
189
|
-
output_single(fault.test_name, fault_color(fault))
|
190
|
-
output_fault_message(fault)
|
191
|
-
else
|
192
|
-
output_single(fault.label, fault_color(fault))
|
193
|
-
output_fault_message(fault)
|
194
|
-
output(fault.test_name)
|
195
|
-
end
|
196
|
-
output_fault_backtrace(fault)
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
def output_fault_message(fault)
|
201
|
-
message = fault.message
|
202
|
-
return if message.nil?
|
203
|
-
|
204
|
-
if message.include?("\n")
|
205
|
-
output(":")
|
206
|
-
message.each_line do |line|
|
207
|
-
output(" #{line.chomp}")
|
208
|
-
end
|
209
|
-
else
|
210
|
-
output(": #{message}")
|
211
|
-
end
|
212
|
-
end
|
213
|
-
|
214
|
-
def output_fault_backtrace(fault)
|
215
|
-
snippet_is_shown = false
|
216
|
-
detector = FaultLocationDetector.new(fault, @code_snippet_fetcher)
|
217
|
-
backtrace = fault.location
|
218
|
-
# workaround for test-spec. :<
|
219
|
-
# see also GitHub:#22
|
220
|
-
backtrace ||= []
|
221
|
-
backtrace.each_with_index do |entry, i|
|
222
|
-
output(entry)
|
223
|
-
next if snippet_is_shown
|
224
|
-
next unless detector.target?(entry)
|
225
|
-
file, line_number, = detector.split_backtrace_entry(entry)
|
226
|
-
snippet_is_shown = output_code_snippet(file, line_number,
|
227
|
-
fault_color(fault))
|
228
|
-
end
|
229
|
-
end
|
230
|
-
|
231
|
-
def output_code_snippet(file, line_number, target_line_color=nil)
|
232
|
-
lines = @code_snippet_fetcher.fetch(file, line_number)
|
233
|
-
return false if lines.empty?
|
234
|
-
|
235
|
-
max_n = lines.collect {|n, line, attributes| n}.max
|
236
|
-
digits = (Math.log10(max_n) + 1).truncate
|
237
|
-
lines.each do |n, line, attributes|
|
238
|
-
if attributes[:target_line?]
|
239
|
-
line_color = target_line_color
|
240
|
-
current_line_mark = "=>"
|
241
|
-
else
|
242
|
-
line_color = nil
|
243
|
-
current_line_mark = ""
|
244
|
-
end
|
245
|
-
output(" %2s %*d: %s" % [current_line_mark, digits, n, line],
|
246
|
-
line_color)
|
247
|
-
end
|
248
|
-
true
|
249
|
-
end
|
250
|
-
|
251
|
-
def output_failure_message(failure)
|
252
|
-
if failure.expected.respond_to?(:encoding) and
|
253
|
-
failure.actual.respond_to?(:encoding) and
|
254
|
-
failure.expected.encoding != failure.actual.encoding
|
255
|
-
need_encoding = true
|
256
|
-
else
|
257
|
-
need_encoding = false
|
258
|
-
end
|
259
|
-
output(failure.user_message) if failure.user_message
|
260
|
-
output_single("<")
|
261
|
-
output_single(failure.inspected_expected, color("pass"))
|
262
|
-
output_single(">")
|
263
|
-
if need_encoding
|
264
|
-
output_single("(")
|
265
|
-
output_single(failure.expected.encoding.name, color("pass"))
|
266
|
-
output_single(")")
|
267
|
-
end
|
268
|
-
output(" expected but was")
|
269
|
-
output_single("<")
|
270
|
-
output_single(failure.inspected_actual, color("failure"))
|
271
|
-
output_single(">")
|
272
|
-
if need_encoding
|
273
|
-
output_single("(")
|
274
|
-
output_single(failure.actual.encoding.name, color("failure"))
|
275
|
-
output_single(")")
|
276
|
-
end
|
277
|
-
output("")
|
278
|
-
from, to = prepare_for_diff(failure.expected, failure.actual)
|
279
|
-
if from and to
|
280
|
-
if need_encoding
|
281
|
-
unless from.valid_encoding?
|
282
|
-
from = from.dup.force_encoding("ASCII-8BIT")
|
283
|
-
end
|
284
|
-
unless to.valid_encoding?
|
285
|
-
to = to.dup.force_encoding("ASCII-8BIT")
|
286
|
-
end
|
287
|
-
end
|
288
|
-
from_lines = from.split(/\r?\n/)
|
289
|
-
to_lines = to.split(/\r?\n/)
|
290
|
-
if need_encoding
|
291
|
-
from_lines << ""
|
292
|
-
to_lines << ""
|
293
|
-
from_lines << "Encoding: #{failure.expected.encoding.name}"
|
294
|
-
to_lines << "Encoding: #{failure.actual.encoding.name}"
|
295
|
-
end
|
296
|
-
differ = ColorizedReadableDiffer.new(from_lines, to_lines, self)
|
297
|
-
if differ.need_diff?
|
298
|
-
output("")
|
299
|
-
output("diff:")
|
300
|
-
differ.diff
|
301
|
-
end
|
302
|
-
end
|
303
|
-
end
|
304
|
-
|
305
|
-
def output_fault_in_short(fault)
|
306
|
-
output_single(fault.message, fault_color(fault))
|
307
|
-
output(" [#{fault.test_name}]")
|
308
|
-
output(fault.location.first)
|
309
|
-
end
|
310
|
-
|
311
|
-
def format_fault(fault)
|
312
|
-
fault.long_display
|
313
|
-
end
|
314
|
-
|
315
|
-
def output_statistics(elapsed_time)
|
316
|
-
output("Finished in #{elapsed_time} seconds.")
|
317
|
-
output_summary_marker
|
318
|
-
output(@result)
|
319
|
-
output("%g%% passed" % @result.pass_percentage)
|
320
|
-
unless elapsed_time.zero?
|
321
|
-
output_summary_marker
|
322
|
-
test_throughput = @result.run_count / elapsed_time
|
323
|
-
assertion_throughput = @result.assertion_count / elapsed_time
|
324
|
-
throughput = [
|
325
|
-
"%.2f tests/s" % test_throughput,
|
326
|
-
"%.2f assertions/s" % assertion_throughput,
|
327
|
-
]
|
328
|
-
output(throughput.join(", "))
|
329
|
-
end
|
330
|
-
end
|
331
|
-
|
332
|
-
def output_summary_marker
|
333
|
-
term_width = guess_term_width
|
334
|
-
if term_width.zero?
|
335
|
-
marker_width = 6
|
336
|
-
else
|
337
|
-
marker_width = term_width
|
338
|
-
end
|
339
|
-
output("-" * marker_width, summary_marker_color)
|
340
|
-
end
|
341
|
-
|
342
|
-
def test_started(test)
|
343
|
-
return unless output?(VERBOSE)
|
344
|
-
|
345
|
-
name = test.name.sub(/\(.+?\)\z/, '')
|
346
|
-
right_space = 8 * 2
|
347
|
-
left_space = @progress_row_max - right_space
|
348
|
-
left_space = left_space - indent.size - name.size
|
349
|
-
tab_stop = "\t" * ([left_space - 1, 0].max / 8)
|
350
|
-
output_single("#{indent}#{name}:#{tab_stop}", nil, VERBOSE)
|
351
|
-
@test_start = Time.now
|
352
|
-
end
|
353
|
-
|
354
|
-
def test_finished(test)
|
355
|
-
unless @already_outputted
|
356
|
-
output_progress(".", color("pass-marker"))
|
357
|
-
end
|
358
|
-
@already_outputted = false
|
359
|
-
|
360
|
-
return unless output?(VERBOSE)
|
361
|
-
|
362
|
-
output(": (%f)" % (Time.now - @test_start), nil, VERBOSE)
|
363
|
-
end
|
364
|
-
|
365
|
-
def suite_name(prefix, suite)
|
366
|
-
name = suite.name
|
367
|
-
if name.nil?
|
368
|
-
"(anonymous)"
|
369
|
-
else
|
370
|
-
name.sub(/\A#{Regexp.escape(prefix)}/, "")
|
371
|
-
end
|
372
|
-
end
|
373
|
-
|
374
|
-
def test_suite_started(suite)
|
375
|
-
last_test_suite = @test_suites.last
|
376
|
-
@test_suites << suite
|
377
|
-
if @top_level
|
378
|
-
@top_level = false
|
379
|
-
return
|
380
|
-
end
|
381
|
-
|
382
|
-
output_single(indent, nil, VERBOSE)
|
383
|
-
if suite.test_case.nil?
|
384
|
-
_color = color("suite")
|
385
|
-
else
|
386
|
-
_color = color("case")
|
387
|
-
end
|
388
|
-
prefix = "#{last_test_suite.name}::"
|
389
|
-
output_single(suite_name(prefix, suite), _color, VERBOSE)
|
390
|
-
output(": ", nil, VERBOSE)
|
391
|
-
@indent += 2
|
392
|
-
end
|
393
|
-
|
394
|
-
def test_suite_finished(suite)
|
395
|
-
@indent -= 2
|
396
|
-
@test_suites.pop
|
397
|
-
end
|
398
|
-
|
399
|
-
def indent
|
400
|
-
if output?(VERBOSE)
|
401
|
-
" " * @indent
|
402
|
-
else
|
403
|
-
""
|
404
|
-
end
|
405
|
-
end
|
406
|
-
|
407
|
-
def nl(level=nil)
|
408
|
-
output("", nil, level)
|
409
|
-
end
|
410
|
-
|
411
|
-
def output(something, color=nil, level=nil)
|
412
|
-
return unless output?(level)
|
413
|
-
output_single(something, color, level)
|
414
|
-
@output.puts
|
415
|
-
end
|
416
|
-
|
417
|
-
def output_single(something, color=nil, level=nil)
|
418
|
-
return false unless output?(level)
|
419
|
-
if @use_color and color
|
420
|
-
something = "%s%s%s" % [color.escape_sequence,
|
421
|
-
something,
|
422
|
-
@reset_color.escape_sequence]
|
423
|
-
end
|
424
|
-
@output.write(something)
|
425
|
-
@output.flush
|
426
|
-
true
|
427
|
-
end
|
428
|
-
|
429
|
-
def output_progress(mark, color=nil)
|
430
|
-
if output_single(mark, color, PROGRESS_ONLY)
|
431
|
-
return unless @progress_row_max > 0
|
432
|
-
@progress_row += mark.size
|
433
|
-
if @progress_row >= @progress_row_max
|
434
|
-
nl unless @output_level == VERBOSE
|
435
|
-
@progress_row = 0
|
436
|
-
end
|
437
|
-
end
|
438
|
-
end
|
439
|
-
|
440
|
-
def output_progress_in_detail_marker(fault)
|
441
|
-
if @progress_row_max > 0
|
442
|
-
output("=" * @progress_row_max)
|
443
|
-
else
|
444
|
-
nl
|
445
|
-
end
|
446
|
-
end
|
447
|
-
|
448
|
-
def output_progress_in_detail(fault)
|
449
|
-
return if @output_level == SILENT
|
450
|
-
nl
|
451
|
-
output_progress_in_detail_marker(fault)
|
452
|
-
if categorize_fault(fault) == :need_detail_faults
|
453
|
-
output_fault_in_detail(fault)
|
454
|
-
else
|
455
|
-
output_fault_in_short(fault)
|
456
|
-
end
|
457
|
-
output_progress_in_detail_marker(fault)
|
458
|
-
@progress_row = 0
|
459
|
-
end
|
460
|
-
|
461
|
-
def output?(level)
|
462
|
-
(level || @current_output_level) <= @output_level
|
463
|
-
end
|
464
|
-
|
465
|
-
def color(name)
|
466
|
-
_color = @color_scheme[name]
|
467
|
-
_color ||= @color_scheme["success"] if name == "pass"
|
468
|
-
_color ||= ColorScheme.default[name]
|
469
|
-
_color
|
470
|
-
end
|
471
|
-
|
472
|
-
def fault_class_color_name(fault_class)
|
473
|
-
fault_class.name.split(/::/).last.downcase
|
474
|
-
end
|
475
|
-
|
476
|
-
def fault_color(fault)
|
477
|
-
color(fault_class_color_name(fault.class))
|
478
|
-
end
|
479
|
-
|
480
|
-
def fault_marker_color(fault)
|
481
|
-
color("#{fault_class_color_name(fault.class)}-marker")
|
482
|
-
end
|
483
|
-
|
484
|
-
def summary_marker_color
|
485
|
-
color("#{@result.status}-marker")
|
486
|
-
end
|
487
|
-
|
488
|
-
def guess_color_availability
|
489
|
-
return false unless @output.tty?
|
490
|
-
return true if windows? and ruby_2_0_or_later?
|
491
|
-
case ENV["TERM"]
|
492
|
-
when /(?:term|screen)(?:-(?:256)?color)?\z/
|
493
|
-
true
|
494
|
-
else
|
495
|
-
return true if ENV["EMACS"] == "t"
|
496
|
-
false
|
497
|
-
end
|
498
|
-
end
|
499
|
-
|
500
|
-
def windows?
|
501
|
-
/mswin|mingw/ === RUBY_PLATFORM
|
502
|
-
end
|
503
|
-
|
504
|
-
def ruby_2_0_or_later?
|
505
|
-
RUBY_VERSION >= "2.0.0"
|
506
|
-
end
|
507
|
-
|
508
|
-
def guess_progress_row_max
|
509
|
-
term_width = guess_term_width
|
510
|
-
if term_width.zero?
|
511
|
-
if ENV["EMACS"] == "t"
|
512
|
-
-1
|
513
|
-
else
|
514
|
-
79
|
515
|
-
end
|
516
|
-
else
|
517
|
-
term_width
|
518
|
-
end
|
519
|
-
end
|
520
|
-
|
521
|
-
def guess_term_width
|
522
|
-
guess_term_width_from_io || guess_term_width_from_env || 0
|
523
|
-
end
|
524
|
-
|
525
|
-
def guess_term_width_from_io
|
526
|
-
if @output.respond_to?(:winsize)
|
527
|
-
begin
|
528
|
-
@output.winsize[1]
|
529
|
-
rescue SystemCallError
|
530
|
-
nil
|
531
|
-
end
|
532
|
-
else
|
533
|
-
nil
|
534
|
-
end
|
535
|
-
end
|
536
|
-
|
537
|
-
def guess_term_width_from_env
|
538
|
-
env = ENV["COLUMNS"] || ENV["TERM_WIDTH"]
|
539
|
-
return nil if env.nil?
|
540
|
-
|
541
|
-
begin
|
542
|
-
Integer(env)
|
543
|
-
rescue ArgumentError
|
544
|
-
nil
|
545
|
-
end
|
546
|
-
end
|
547
|
-
end
|
548
|
-
|
549
|
-
class ColorizedReadableDiffer < Diff::ReadableDiffer
|
550
|
-
def initialize(from, to, runner)
|
551
|
-
@runner = runner
|
552
|
-
super(from, to)
|
553
|
-
end
|
554
|
-
|
555
|
-
def need_diff?(options={})
|
556
|
-
return false if one_line_all_change?
|
557
|
-
operations.each do |tag,|
|
558
|
-
return true if [:replace, :equal].include?(tag)
|
559
|
-
end
|
560
|
-
false
|
561
|
-
end
|
562
|
-
|
563
|
-
private
|
564
|
-
def one_line_all_change?
|
565
|
-
return false if operations.size != 1
|
566
|
-
|
567
|
-
tag, from_start, from_end, to_start, to_end = operations.first
|
568
|
-
return false if tag != :replace
|
569
|
-
return false if [from_start, from_end] != [0, 1]
|
570
|
-
return false if [from_start, from_end] != [to_start, to_end]
|
571
|
-
|
572
|
-
_, _, _line_operations = line_operations(@from.first, @to.first)
|
573
|
-
_line_operations.size == 1
|
574
|
-
end
|
575
|
-
|
576
|
-
def output_single(something, color=nil)
|
577
|
-
@runner.__send__(:output_single, something, color)
|
578
|
-
end
|
579
|
-
|
580
|
-
def output(something, color=nil)
|
581
|
-
@runner.__send__(:output, something, color)
|
582
|
-
end
|
583
|
-
|
584
|
-
def color(name)
|
585
|
-
@runner.__send__(:color, name)
|
586
|
-
end
|
587
|
-
|
588
|
-
def cut_off_ratio
|
589
|
-
0
|
590
|
-
end
|
591
|
-
|
592
|
-
def default_ratio
|
593
|
-
0
|
594
|
-
end
|
595
|
-
|
596
|
-
def tag(mark, color_name, contents)
|
597
|
-
_color = color(color_name)
|
598
|
-
contents.each do |content|
|
599
|
-
output_single(mark, _color)
|
600
|
-
output_single(" ")
|
601
|
-
output(content)
|
602
|
-
end
|
603
|
-
end
|
604
|
-
|
605
|
-
def tag_deleted(contents)
|
606
|
-
tag("-", "diff-deleted-tag", contents)
|
607
|
-
end
|
608
|
-
|
609
|
-
def tag_inserted(contents)
|
610
|
-
tag("+", "diff-inserted-tag", contents)
|
611
|
-
end
|
612
|
-
|
613
|
-
def tag_equal(contents)
|
614
|
-
tag(" ", "normal", contents)
|
615
|
-
end
|
616
|
-
|
617
|
-
def tag_difference(contents)
|
618
|
-
tag("?", "diff-difference-tag", contents)
|
619
|
-
end
|
620
|
-
|
621
|
-
def diff_line(from_line, to_line)
|
622
|
-
to_operations = []
|
623
|
-
from_line, to_line, _operations = line_operations(from_line, to_line)
|
624
|
-
|
625
|
-
no_replace = true
|
626
|
-
_operations.each do |tag,|
|
627
|
-
if tag == :replace
|
628
|
-
no_replace = false
|
629
|
-
break
|
630
|
-
end
|
631
|
-
end
|
632
|
-
|
633
|
-
output_single("?", color("diff-difference-tag"))
|
634
|
-
output_single(" ")
|
635
|
-
_operations.each do |tag, from_start, from_end, to_start, to_end|
|
636
|
-
from_width = compute_width(from_line, from_start, from_end)
|
637
|
-
to_width = compute_width(to_line, to_start, to_end)
|
638
|
-
case tag
|
639
|
-
when :replace
|
640
|
-
output_single(from_line[from_start...from_end],
|
641
|
-
color("diff-deleted"))
|
642
|
-
if (from_width < to_width)
|
643
|
-
output_single(" " * (to_width - from_width))
|
644
|
-
end
|
645
|
-
to_operations << Proc.new do
|
646
|
-
output_single(to_line[to_start...to_end],
|
647
|
-
color("diff-inserted"))
|
648
|
-
if (to_width < from_width)
|
649
|
-
output_single(" " * (from_width - to_width))
|
650
|
-
end
|
651
|
-
end
|
652
|
-
when :delete
|
653
|
-
output_single(from_line[from_start...from_end],
|
654
|
-
color("diff-deleted"))
|
655
|
-
unless no_replace
|
656
|
-
to_operations << Proc.new {output_single(" " * from_width)}
|
657
|
-
end
|
658
|
-
when :insert
|
659
|
-
if no_replace
|
660
|
-
output_single(to_line[to_start...to_end],
|
661
|
-
color("diff-inserted"))
|
662
|
-
else
|
663
|
-
output_single(" " * to_width)
|
664
|
-
to_operations << Proc.new do
|
665
|
-
output_single(to_line[to_start...to_end],
|
666
|
-
color("diff-inserted"))
|
667
|
-
end
|
668
|
-
end
|
669
|
-
when :equal
|
670
|
-
output_single(from_line[from_start...from_end])
|
671
|
-
unless no_replace
|
672
|
-
to_operations << Proc.new {output_single(" " * to_width)}
|
673
|
-
end
|
674
|
-
else
|
675
|
-
raise "unknown tag: #{tag}"
|
676
|
-
end
|
677
|
-
end
|
678
|
-
output("")
|
679
|
-
|
680
|
-
unless to_operations.empty?
|
681
|
-
output_single("?", color("diff-difference-tag"))
|
682
|
-
output_single(" ")
|
683
|
-
to_operations.each do |operation|
|
684
|
-
operation.call
|
685
|
-
end
|
686
|
-
output("")
|
687
|
-
end
|
688
|
-
end
|
689
|
-
end
|
690
|
-
end
|
691
|
-
end
|
692
|
-
end
|
693
|
-
end
|