From e4ac02cd8dfe45f39ad915bdb58192e57aca3d9d Mon Sep 17 00:00:00 2001 From: gsinclair Date: Sun, 16 May 2004 04:16:39 +0000 Subject: [PATCH] * lib/test/unit/**/*.rb: Removed :nodoc: directives (many were generating warnings, many were on private methods). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++ lib/test/unit/assertionfailederror.rb | 2 - lib/test/unit/assertions.rb | 12 ++-- lib/test/unit/error.rb | 2 - lib/test/unit/failure.rb | 2 - lib/test/unit/testcase.rb | 10 ++- lib/test/unit/testresult.rb | 2 - lib/test/unit/testsuite.rb | 2 - lib/test/unit/ui/console/testrunner.rb | 14 ++-- lib/test/unit/ui/fox/testrunner.rb | 52 +++++++-------- lib/test/unit/ui/gtk/testrunner.rb | 86 ++++++++++++------------- lib/test/unit/ui/gtk2/testrunner.rb | 86 ++++++++++++------------- lib/test/unit/ui/testrunnermediator.rb | 4 +- lib/test/unit/ui/testrunnerutilities.rb | 2 - lib/test/unit/ui/tk/testrunner.rb | 32 +++++---- lib/test/unit/util/observable.rb | 6 +- lib/test/unit/util/procwrapper.rb | 8 +-- 17 files changed, 150 insertions(+), 177 deletions(-) diff --git a/ChangeLog b/ChangeLog index d51cf9af00..a67e6ab4f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 16 13:10:00 2004 Gavin Sinclair + + * lib/test/unit/**/*.rb: Removed :nodoc: directives (many were + generating warnings, many were on private methods). + Sat May 15 01:41:34 2004 Yukihiro Matsumoto * eval.c (eval): forgot to restore $SAFE value before evaluating diff --git a/lib/test/unit/assertionfailederror.rb b/lib/test/unit/assertionfailederror.rb index 0854203675..afbfa1f2eb 100644 --- a/lib/test/unit/assertionfailederror.rb +++ b/lib/test/unit/assertionfailederror.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 001bb428d0..9dd9baf730 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -7,8 +5,8 @@ require 'test/unit/assertionfailederror' require 'test/unit/util/backtracefilter' -module Test # :nodoc: - module Unit # :nodoc: +module Test + module Unit # Contains all of the standard Test::Unit assertions. Mixed in # to Test::Unit::TestCase. To mix it in and use its @@ -341,13 +339,13 @@ EOT end public - def build_message(head, template=nil, *arguments) # :nodoc: + def build_message(head, template=nil, *arguments) template &&= template.chomp return AssertionMessage.new(head, template, arguments) end private - def _wrap_assertion # :nodoc: + def _wrap_assertion @_assertion_wrapped ||= false unless (@_assertion_wrapped) @_assertion_wrapped = true @@ -375,7 +373,7 @@ EOT AssertionMessage.use_pp = value end - class AssertionMessage # :nodoc: all + class AssertionMessage all @use_pp = true class << self attr_accessor :use_pp diff --git a/lib/test/unit/error.rb b/lib/test/unit/error.rb index 90ac04cf3b..a762519fe5 100644 --- a/lib/test/unit/error.rb +++ b/lib/test/unit/error.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. diff --git a/lib/test/unit/failure.rb b/lib/test/unit/failure.rb index 42cc9d4b8c..bc6f66d74e 100644 --- a/lib/test/unit/failure.rb +++ b/lib/test/unit/failure.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb index 9c1c41d749..b0ed5fd636 100644 --- a/lib/test/unit/testcase.rb +++ b/lib/test/unit/testcase.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -109,22 +107,22 @@ module Test end private :passed? - def size # :nodoc: + def size 1 end - def add_assertion # :nodoc: + def add_assertion @_result.add_assertion end private :add_assertion - def add_failure(message, all_locations=caller()) # :nodoc: + def add_failure(message, all_locations=caller()) @test_passed = false @_result.add_failure(Failure.new(name, filter_backtrace(all_locations), message)) end private :add_failure - def add_error(exception) # :nodoc: + def add_error(exception) @test_passed = false @_result.add_error(Error.new(name, exception)) end diff --git a/lib/test/unit/testresult.rb b/lib/test/unit/testresult.rb index b1bfbf72e4..c566f69533 100644 --- a/lib/test/unit/testresult.rb +++ b/lib/test/unit/testresult.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. diff --git a/lib/test/unit/testsuite.rb b/lib/test/unit/testsuite.rb index 56ad9b7aec..bc5500a6f9 100644 --- a/lib/test/unit/testsuite.rb +++ b/lib/test/unit/testsuite.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. # License:: Ruby license. diff --git a/lib/test/unit/ui/console/testrunner.rb b/lib/test/unit/ui/console/testrunner.rb index f20ae9775b..a0a56c6023 100644 --- a/lib/test/unit/ui/console/testrunner.rb +++ b/lib/test/unit/ui/console/testrunner.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -10,7 +8,7 @@ require 'test/unit/ui/testrunnerutilities' module Test module Unit module UI - module Console # :nodoc: + module Console # Runs a Test::Unit::TestSuite on the console. class TestRunner @@ -42,7 +40,7 @@ module Test end private - def setup_mediator # :nodoc: + def setup_mediator @mediator = create_mediator(@suite) suite_name = @suite.to_s if ( @suite.kind_of?(Module) ) @@ -51,11 +49,11 @@ module Test output("Loaded suite #{suite_name}") end - def create_mediator(suite) # :nodoc: + def create_mediator(suite) return TestRunnerMediator.new(suite) end - def attach_to_mediator # :nodoc: + def attach_to_mediator @mediator.add_listener(TestResult::FAULT, &method(:add_fault)) @mediator.add_listener(TestRunnerMediator::STARTED, &method(:started)) @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:finished)) @@ -63,11 +61,11 @@ module Test @mediator.add_listener(TestCase::FINISHED, &method(:test_finished)) end - def start_mediator # :nodoc: + def start_mediator return @mediator.run_suite end - def add_fault(fault) # :nodoc: + def add_fault(fault) @faults << fault output_single(fault.single_character_display, PROGRESS_ONLY) @already_outputted = true diff --git a/lib/test/unit/ui/fox/testrunner.rb b/lib/test/unit/ui/fox/testrunner.rb index 0efbb46a51..4a3a206193 100644 --- a/lib/test/unit/ui/fox/testrunner.rb +++ b/lib/test/unit/ui/fox/testrunner.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -13,7 +11,7 @@ include Fox module Test module Unit module UI - module Fox # :nodoc: + module Fox # Runs a Test::Unit::TestSuite in a Fox UI. Obviously, # this one requires you to have Fox @@ -49,7 +47,7 @@ module Test @result end - def setup_mediator # :nodoc: + def setup_mediator @mediator = TestRunnerMediator.new(@suite) suite_name = @suite.to_s if ( @suite.kind_of?(Module) ) @@ -58,7 +56,7 @@ module Test @suite_name_entry.text = suite_name end - def attach_to_mediator # :nodoc: + def attach_to_mediator @mediator.add_listener(TestRunnerMediator::RESET, &method(:reset_ui)) @mediator.add_listener(TestResult::FAULT, &method(:add_fault)) @mediator.add_listener(TestResult::CHANGED, &method(:result_changed)) @@ -67,7 +65,7 @@ module Test @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:finished)) end - def start_ui # :nodoc: + def start_ui @application.create @window.show(PLACEMENT_SCREEN) @application.addTimeout(1) do @@ -76,11 +74,11 @@ module Test @application.run end - def stop # :nodoc: + def stop @application.exit(0) end - def reset_ui(count) # :nodoc: + def reset_ui(count) @test_progress_bar.barColor = GREEN_STYLE @test_progress_bar.total = count @test_progress_bar.progress = 0 @@ -94,7 +92,7 @@ module Test @fault_list.clearItems end - def add_fault(fault) # :nodoc: + def add_fault(fault) if ( ! @red ) @test_progress_bar.barColor = RED_STYLE @red = true @@ -103,19 +101,19 @@ module Test @fault_list.appendItem(item) end - def show_fault(fault) # :nodoc: + def show_fault(fault) raw_show_fault(fault.long_display) end - def raw_show_fault(string) # :nodoc: + def raw_show_fault(string) @detail_text.setText(string) end - def clear_fault # :nodoc: + def clear_fault raw_show_fault("") end - def result_changed(result) # :nodoc: + def result_changed(result) @test_progress_bar.progress = result.run_count @test_count_label.text = result.run_count.to_s @@ -128,7 +126,7 @@ module Test @application.flush end - def started(result) # :nodoc: + def started(result) @result = result output_status("Started...") end @@ -146,7 +144,7 @@ module Test @status_entry.repaint end - def setup_ui # :nodoc: + def setup_ui @application = create_application create_tooltip(@application) @@ -180,7 +178,7 @@ module Test @detail_text = create_text(detail_panel) end - def create_application # :nodoc: + def create_application app = FXApp.new("TestRunner", "Test::Unit") app.init([]) app @@ -194,25 +192,25 @@ module Test FXTooltip.new(app) end - def create_main_panel(parent) # :nodoc: + def create_main_panel(parent) panel = FXVerticalFrame.new(parent, LAYOUT_FILL_X | LAYOUT_FILL_Y) panel.vSpacing = 10 panel end - def create_suite_panel(parent) # :nodoc: + def create_suite_panel(parent) FXHorizontalFrame.new(parent, LAYOUT_SIDE_LEFT | LAYOUT_FILL_X) end - def create_button(parent, text, action) # :nodoc: + def create_button(parent, text, action) FXButton.new(parent, text).connect(SEL_COMMAND, &action) end - def create_progress_bar(parent) # :nodoc: + def create_progress_bar(parent) FXProgressBar.new(parent, nil, 0, PROGRESSBAR_NORMAL | LAYOUT_FILL_X) end - def create_info_panel(parent) # :nodoc: + def create_info_panel(parent) FXMatrix.new(parent, 1, MATRIX_BY_ROWS | LAYOUT_FILL_X) end @@ -220,11 +218,11 @@ module Test FXLabel.new(parent, text, nil, JUSTIFY_CENTER_X | LAYOUT_FILL_COLUMN) end - def create_list_panel(parent) # :nodoc: + def create_list_panel(parent) FXHorizontalFrame.new(parent, LAYOUT_FILL_X | FRAME_SUNKEN | FRAME_THICK) end - def create_fault_list(parent) # :nodoc: + def create_fault_list(parent) list = FXList.new(parent, 10, nil, 0, LIST_SINGLESELECT | LAYOUT_FILL_X) #, 0, 0, 0, 150) list.connect(SEL_COMMAND) do |sender, sel, ptr| if sender.retrieveItem(sender.currentItem).selected? @@ -236,22 +234,22 @@ module Test list end - def create_detail_panel(parent) # :nodoc: + def create_detail_panel(parent) FXHorizontalFrame.new(parent, LAYOUT_FILL_X | LAYOUT_FILL_Y | FRAME_SUNKEN | FRAME_THICK) end - def create_text(parent) # :nodoc: + def create_text(parent) FXText.new(parent, nil, 0, TEXT_READONLY | LAYOUT_FILL_X | LAYOUT_FILL_Y) end - def create_entry(parent) # :nodoc: + def create_entry(parent) entry = FXTextField.new(parent, 30, nil, 0, TEXTFIELD_NORMAL | LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X) entry.disable entry end end - class FaultListItem < FXListItem # :nodoc: all + class FaultListItem < FXListItem all attr_reader(:fault) def initialize(fault) super(fault.short_display) diff --git a/lib/test/unit/ui/gtk/testrunner.rb b/lib/test/unit/ui/gtk/testrunner.rb index 2e962ca184..8bd7f0e2fc 100644 --- a/lib/test/unit/ui/gtk/testrunner.rb +++ b/lib/test/unit/ui/gtk/testrunner.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -11,7 +9,7 @@ require 'test/unit/ui/testrunnerutilities' module Test module Unit module UI - module GTK # :nodoc: + module GTK # Runs a Test::Unit::TestSuite in a Gtk UI. Obviously, # this one requires you to have Gtk @@ -49,7 +47,7 @@ module Test end private - def setup_mediator # :nodoc: + def setup_mediator @mediator = TestRunnerMediator.new(@suite) suite_name = @suite.to_s if ( @suite.kind_of?(Module) ) @@ -58,7 +56,7 @@ module Test suite_name_entry.set_text(suite_name) end - def attach_to_mediator # :nodoc: + def attach_to_mediator run_button.signal_connect("clicked", nil, &method(:run_test)) @mediator.add_listener(TestRunnerMediator::RESET, &method(:reset_ui)) @mediator.add_listener(TestResult::FAULT, &method(:add_fault)) @@ -73,7 +71,7 @@ module Test @runner.raise(@restart_signal) end - def start_ui # :nodoc: + def start_ui @viewer.run running = false begin @@ -93,11 +91,11 @@ module Test end end - def stop(*) # :nodoc: + def stop(*) Gtk.main_quit end - def reset_ui(count) # :nodoc: + def reset_ui(count) test_progress_bar.set_style(green_style) test_progress_bar.configure(0, 0, count) @red = false @@ -110,7 +108,7 @@ module Test fault_list.remove_items(fault_list.children) end - def add_fault(fault) # :nodoc: + def add_fault(fault) if ( ! @red ) test_progress_bar.set_style(red_style) @red = true @@ -120,27 +118,27 @@ module Test fault_list.append_items([item]) end - def show_fault(fault) # :nodoc: + def show_fault(fault) raw_show_fault(fault.long_display) end - def raw_show_fault(string) # :nodoc: + def raw_show_fault(string) fault_detail_label.set_text(string) outer_detail_sub_panel.queue_resize end - def clear_fault # :nodoc: + def clear_fault raw_show_fault("") end - def result_changed(result) # :nodoc: + def result_changed(result) run_count_label.set_text(result.run_count.to_s) assertion_count_label.set_text(result.assertion_count.to_s) failure_count_label.set_text(result.failure_count.to_s) error_count_label.set_text(result.error_count.to_s) end - def started(result) # :nodoc: + def started(result) @result = result output_status("Started...") end @@ -157,11 +155,11 @@ module Test output_status("Finished in #{elapsed_time} seconds") end - def output_status(string) # :nodoc: + def output_status(string) status_entry.set_text(string) end - def setup_ui # :nodoc: + def setup_ui main_window.signal_connect("destroy", nil, &method(:stop)) main_window.show_all fault_list.signal_connect("select-child", nil) { @@ -174,7 +172,7 @@ module Test @red = false end - def main_window # :nodoc: + def main_window lazy_initialize(:main_window) { @main_window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL) @main_window.set_title("Test::Unit TestRunner") @@ -185,7 +183,7 @@ module Test } end - def main_panel # :nodoc: + def main_panel lazy_initialize(:main_panel) { @main_panel = Gtk::VBox.new(false, 0) @main_panel.pack_start(suite_panel, false, false, 0) @@ -197,7 +195,7 @@ module Test } end - def suite_panel # :nodoc: + def suite_panel lazy_initialize(:suite_panel) { @suite_panel = Gtk::HBox.new(false, 10) @suite_panel.border_width(10) @@ -207,20 +205,20 @@ module Test } end - def suite_name_entry # :nodoc: + def suite_name_entry lazy_initialize(:suite_name_entry) { @suite_name_entry = Gtk::Entry.new @suite_name_entry.set_editable(false) } end - def run_button # :nodoc: + def run_button lazy_initialize(:run_button) { @run_button = Gtk::Button.new("Run") } end - def progress_panel # :nodoc: + def progress_panel lazy_initialize(:progress_panel) { @progress_panel = Gtk::HBox.new(false, 10) @progress_panel.border_width(10) @@ -228,7 +226,7 @@ module Test } end - def test_progress_bar # :nodoc: + def test_progress_bar lazy_initialize(:test_progress_bar) { @test_progress_bar = EnhancedProgressBar.new @test_progress_bar.set_usize(@test_progress_bar.allocation.width, @@ -237,21 +235,21 @@ module Test } end - def green_style # :nodoc: + def green_style lazy_initialize(:green_style) { @green_style = Gtk::Style.new @green_style.set_bg(Gtk::STATE_PRELIGHT, 0x0000, 0xFFFF, 0x0000) } end - def red_style # :nodoc: + def red_style lazy_initialize(:red_style) { @red_style = Gtk::Style.new @red_style.set_bg(Gtk::STATE_PRELIGHT, 0xFFFF, 0x0000, 0x0000) } end - def info_panel # :nodoc: + def info_panel lazy_initialize(:info_panel) { @info_panel = Gtk::HBox.new(false, 0) @info_panel.border_width(10) @@ -266,35 +264,35 @@ module Test } end - def run_count_label # :nodoc: + def run_count_label lazy_initialize(:run_count_label) { @run_count_label = Gtk::Label.new("0") @run_count_label.set_justify(Gtk::JUSTIFY_LEFT) } end - def assertion_count_label # :nodoc: + def assertion_count_label lazy_initialize(:assertion_count_label) { @assertion_count_label = Gtk::Label.new("0") @assertion_count_label.set_justify(Gtk::JUSTIFY_LEFT) } end - def failure_count_label # :nodoc: + def failure_count_label lazy_initialize(:failure_count_label) { @failure_count_label = Gtk::Label.new("0") @failure_count_label.set_justify(Gtk::JUSTIFY_LEFT) } end - def error_count_label # :nodoc: + def error_count_label lazy_initialize(:error_count_label) { @error_count_label = Gtk::Label.new("0") @error_count_label.set_justify(Gtk::JUSTIFY_LEFT) } end - def list_panel # :nodoc: + def list_panel lazy_initialize(:list_panel) { @list_panel = Gtk::HBox.new @list_panel.border_width(10) @@ -302,7 +300,7 @@ module Test } end - def list_scrolled_window # :nodoc: + def list_scrolled_window lazy_initialize(:list_scrolled_window) { @list_scrolled_window = Gtk::ScrolledWindow.new @list_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) @@ -311,13 +309,13 @@ module Test } end - def fault_list # :nodoc: + def fault_list lazy_initialize(:fault_list) { @fault_list = Gtk::List.new } end - def detail_panel # :nodoc: + def detail_panel lazy_initialize(:detail_panel) { @detail_panel = Gtk::HBox.new @detail_panel.border_width(10) @@ -325,7 +323,7 @@ module Test } end - def detail_scrolled_window # :nodoc: + def detail_scrolled_window lazy_initialize(:detail_scrolled_window) { @detail_scrolled_window = Gtk::ScrolledWindow.new @detail_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) @@ -334,21 +332,21 @@ module Test } end - def outer_detail_sub_panel # :nodoc: + def outer_detail_sub_panel lazy_initialize(:outer_detail_sub_panel) { @outer_detail_sub_panel = Gtk::VBox.new @outer_detail_sub_panel.pack_start(inner_detail_sub_panel, false, false, 0) } end - def inner_detail_sub_panel # :nodoc: + def inner_detail_sub_panel lazy_initialize(:inner_detail_sub_panel) { @inner_detail_sub_panel = Gtk::HBox.new @inner_detail_sub_panel.pack_start(fault_detail_label, false, false, 0) } end - def fault_detail_label # :nodoc: + def fault_detail_label lazy_initialize(:fault_detail_label) { @fault_detail_label = EnhancedLabel.new("") style = Gtk::Style.new @@ -362,7 +360,7 @@ module Test } end - def status_panel # :nodoc: + def status_panel lazy_initialize(:status_panel) { @status_panel = Gtk::HBox.new @status_panel.border_width(10) @@ -370,14 +368,14 @@ module Test } end - def status_entry # :nodoc: + def status_entry lazy_initialize(:status_entry) { @status_entry = Gtk::Entry.new @status_entry.set_editable(false) } end - def lazy_initialize(symbol) # :nodoc: + def lazy_initialize(symbol) if (!instance_eval("defined?(@#{symbol.to_s})")) yield end @@ -385,7 +383,7 @@ module Test end end - class EnhancedProgressBar < Gtk::ProgressBar # :nodoc: all + class EnhancedProgressBar < Gtk::ProgressBar all def set_style(style) super hide @@ -393,13 +391,13 @@ module Test end end - class EnhancedLabel < Gtk::Label # :nodoc: all + class EnhancedLabel < Gtk::Label all def set_text(text) super(text.gsub(/\n\t/, "\n" + (" " * 4))) end end - class FaultListItem < Gtk::ListItem # :nodoc: all + class FaultListItem < Gtk::ListItem all attr_reader(:fault) def initialize(fault) super(fault.short_display) diff --git a/lib/test/unit/ui/gtk2/testrunner.rb b/lib/test/unit/ui/gtk2/testrunner.rb index ecbc9f02df..942bb17af2 100644 --- a/lib/test/unit/ui/gtk2/testrunner.rb +++ b/lib/test/unit/ui/gtk2/testrunner.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Kenta MURATA. # Copyright:: Copyright (c) 2000-2002 Kenta MURATA. All rights reserved. # License:: Ruby license. @@ -11,17 +9,17 @@ require "test/unit/ui/testrunnerutilities" module Test module Unit module UI - module GTK2 # :nodoc: all + module GTK2 all Gtk.init - class EnhancedLabel < Gtk::Label # :nodoc: all + class EnhancedLabel < Gtk::Label all def set_text(text) super(text.gsub(/\n\t/, "\n ")) end end - class FaultList < Gtk::TreeView # :nodoc: all + class FaultList < Gtk::TreeView all def initialize @faults = [] @model = Gtk::ListStore.new(String, String) @@ -56,7 +54,7 @@ module Test class TestRunner extend TestRunnerUtilities - def lazy_initialize(symbol) # :nodoc: + def lazy_initialize(symbol) if !instance_eval("defined?(@#{symbol})") then yield end @@ -64,7 +62,7 @@ module Test end private :lazy_initialize - def status_entry # :nodoc: + def status_entry lazy_initialize(:status_entry) do @status_entry = Gtk::Entry.new @status_entry.editable = false @@ -72,7 +70,7 @@ module Test end private :status_entry - def status_panel # :nodoc: + def status_panel lazy_initialize(:status_panel) do @status_panel = Gtk::HBox.new @status_panel.border_width = 10 @@ -81,7 +79,7 @@ module Test end private :status_panel - def fault_detail_label # :nodoc: + def fault_detail_label lazy_initialize(:fault_detail_label) do @fault_detail_label = EnhancedLabel.new("") # style = Gtk::Style.new @@ -95,7 +93,7 @@ module Test end private :fault_detail_label - def inner_detail_sub_panel # :nodoc: + def inner_detail_sub_panel lazy_initialize(:inner_detail_sub_panel) do @inner_detail_sub_panel = Gtk::HBox.new @inner_detail_sub_panel.pack_start(fault_detail_label, false, false, 0) @@ -103,7 +101,7 @@ module Test end private :inner_detail_sub_panel - def outer_detail_sub_panel # :nodoc: + def outer_detail_sub_panel lazy_initialize(:outer_detail_sub_panel) do @outer_detail_sub_panel = Gtk::VBox.new @outer_detail_sub_panel.pack_start(inner_detail_sub_panel, false, false, 0) @@ -111,7 +109,7 @@ module Test end private :outer_detail_sub_panel - def detail_scrolled_window # :nodoc: + def detail_scrolled_window lazy_initialize(:detail_scrolled_window) do @detail_scrolled_window = Gtk::ScrolledWindow.new @detail_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) @@ -122,7 +120,7 @@ module Test end private :detail_scrolled_window - def detail_panel # :nodoc: + def detail_panel lazy_initialize(:detail_panel) do @detail_panel = Gtk::HBox.new @detail_panel.border_width = 10 @@ -131,14 +129,14 @@ module Test end private :detail_panel - def fault_list # :nodoc: + def fault_list lazy_initialize(:fault_list) do @fault_list = FaultList.new end end private :fault_list - def list_scrolled_window # :nodoc: + def list_scrolled_window lazy_initialize(:list_scrolled_window) do @list_scrolled_window = Gtk::ScrolledWindow.new @list_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) @@ -149,7 +147,7 @@ module Test end private :list_scrolled_window - def list_panel # :nodoc: + def list_panel lazy_initialize(:list_panel) do @list_panel = Gtk::HBox.new @list_panel.border_width = 10 @@ -158,7 +156,7 @@ module Test end private :list_panel - def error_count_label # :nodoc: + def error_count_label lazy_initialize(:error_count_label) do @error_count_label = Gtk::Label.new("0") @error_count_label.justify = Gtk::JUSTIFY_LEFT @@ -166,7 +164,7 @@ module Test end private :error_count_label - def failure_count_label # :nodoc: + def failure_count_label lazy_initialize(:failure_count_label) do @failure_count_label = Gtk::Label.new("0") @failure_count_label.justify = Gtk::JUSTIFY_LEFT @@ -174,7 +172,7 @@ module Test end private :failure_count_label - def assertion_count_label # :nodoc: + def assertion_count_label lazy_initialize(:assertion_count_label) do @assertion_count_label = Gtk::Label.new("0") @assertion_count_label.justify = Gtk::JUSTIFY_LEFT @@ -182,7 +180,7 @@ module Test end private :assertion_count_label - def run_count_label # :nodoc: + def run_count_label lazy_initialize(:run_count_label) do @run_count_label = Gtk::Label.new("0") @run_count_label.justify = Gtk::JUSTIFY_LEFT @@ -190,7 +188,7 @@ module Test end private :run_count_label - def info_panel # :nodoc: + def info_panel lazy_initialize(:info_panel) do @info_panel = Gtk::HBox.new(false, 0) @info_panel.border_width = 10 @@ -206,7 +204,7 @@ module Test end # def info_panel private :info_panel - def green_style # :nodoc: + def green_style lazy_initialize(:green_style) do @green_style = Gtk::Style.new @green_style.set_bg(Gtk::STATE_PRELIGHT, 0x0000, 0xFFFF, 0x0000) @@ -214,7 +212,7 @@ module Test end # def green_style private :green_style - def red_style # :nodoc: + def red_style lazy_initialize(:red_style) do @red_style = Gtk::Style.new @red_style.set_bg(Gtk::STATE_PRELIGHT, 0xFFFF, 0x0000, 0x0000) @@ -222,7 +220,7 @@ module Test end # def red_style private :red_style - def test_progress_bar # :nodoc: + def test_progress_bar lazy_initialize(:test_progress_bar) { @test_progress_bar = Gtk::ProgressBar.new @test_progress_bar.fraction = 0.0 @@ -234,7 +232,7 @@ module Test end # def test_progress_bar private :test_progress_bar - def progress_panel # :nodoc: + def progress_panel lazy_initialize(:progress_panel) do @progress_panel = Gtk::HBox.new(false, 10) @progress_panel.border_width = 10 @@ -242,13 +240,13 @@ module Test end end # def progress_panel - def run_button # :nodoc: + def run_button lazy_initialize(:run_button) do @run_button = Gtk::Button.new("Run") end end # def run_button - def suite_name_entry # :nodoc: + def suite_name_entry lazy_initialize(:suite_name_entry) do @suite_name_entry = Gtk::Entry.new @suite_name_entry.editable = false @@ -256,7 +254,7 @@ module Test end # def suite_name_entry private :suite_name_entry - def suite_panel # :nodoc: + def suite_panel lazy_initialize(:suite_panel) do @suite_panel = Gtk::HBox.new(false, 10) @suite_panel.border_width = 10 @@ -267,7 +265,7 @@ module Test end # def suite_panel private :suite_panel - def main_panel # :nodoc: + def main_panel lazy_initialize(:main_panel) do @main_panel = Gtk::VBox.new(false, 0) @main_panel.pack_start(suite_panel, false, false, 0) @@ -280,7 +278,7 @@ module Test end # def main_panel private :main_panel - def main_window # :nodoc: + def main_window lazy_initialize(:main_window) do @main_window = Gtk::Window.new(Gtk::Window::TOPLEVEL) @main_window.set_title("Test::Unit TestRunner") @@ -291,7 +289,7 @@ module Test end # def main_window private :main_window - def setup_ui # :nodoc: + def setup_ui main_window.signal_connect("destroy", nil) { stop } main_window.show_all fault_list.selection.signal_connect("changed", nil) do @@ -305,33 +303,33 @@ module Test end # def setup_ui private :setup_ui - def output_status(string) # :nodoc: + def output_status(string) status_entry.set_text(string) end # def output_status(string) private :output_status - def finished(elapsed_time) # :nodoc: + def finished(elapsed_time) test_progress_bar.fraction = 1.0 output_status("Finished in #{elapsed_time} seconds") end # def finished(elapsed_time) private :finished - def test_started(test_name) # :nodoc: + def test_started(test_name) output_status("Running #{test_name}...") end # def test_started(test_name) private :test_started - def started(result) # :nodoc: + def started(result) @result = result output_status("Started...") end # def started(result) private :started - def test_finished(result) # :nodoc: + def test_finished(result) test_progress_bar.fraction += 1.0 / @count end # def test_finished(result) - def result_changed(result) # :nodoc: + def result_changed(result) run_count_label.label = result.run_count.to_s assertion_count_label.label = result.assertion_count.to_s failure_count_label.label = result.failure_count.to_s @@ -339,23 +337,23 @@ module Test end # def result_changed(result) private :result_changed - def clear_fault # :nodoc: + def clear_fault raw_show_fault("") end # def clear_fault private :clear_fault - def raw_show_fault(string) # :nodoc: + def raw_show_fault(string) fault_detail_label.set_text(string) outer_detail_sub_panel.queue_resize end # def raw_show_fault(string) private :raw_show_fault - def show_fault(fault) # :nodoc: + def show_fault(fault) raw_show_fault(fault.long_display) end # def show_fault(fault) private :show_fault - def add_fault(fault) # :nodoc: + def add_fault(fault) if not @red then test_progress_bar.style = red_style @red = true @@ -364,7 +362,7 @@ module Test end # def add_fault(fault) private :add_fault - def reset_ui(count) # :nodoc: + def reset_ui(count) test_progress_bar.style = green_style test_progress_bar.fraction = 0.0 @count = count + 1 @@ -379,7 +377,7 @@ module Test end # def reset_ui(count) private :reset_ui - def stop # :nodoc: + def stop Gtk.main_quit end # def stop private :stop @@ -389,7 +387,7 @@ module Test end private :run_test - def start_ui # :nodoc + def start_ui @viewer.run running = false begin diff --git a/lib/test/unit/ui/testrunnermediator.rb b/lib/test/unit/ui/testrunnermediator.rb index 4fad47a853..a0e864000b 100644 --- a/lib/test/unit/ui/testrunnermediator.rb +++ b/lib/test/unit/ui/testrunnermediator.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -10,7 +8,7 @@ require 'test/unit/testresult' module Test module Unit - module UI # :nodoc: + module UI # Provides an interface to write any given UI against, # hopefully making it easy to write new UIs. diff --git a/lib/test/unit/ui/testrunnerutilities.rb b/lib/test/unit/ui/testrunnerutilities.rb index bc75e0b9ab..950b03a73a 100644 --- a/lib/test/unit/ui/testrunnerutilities.rb +++ b/lib/test/unit/ui/testrunnerutilities.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. diff --git a/lib/test/unit/ui/tk/testrunner.rb b/lib/test/unit/ui/tk/testrunner.rb index c962471b64..d16ffe4b99 100644 --- a/lib/test/unit/ui/tk/testrunner.rb +++ b/lib/test/unit/ui/tk/testrunner.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Original Author:: Nathaniel Talbott. # Author:: Kazuhiro NISHIYAMA. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. @@ -13,7 +11,7 @@ require 'test/unit/ui/testrunnerutilities' module Test module Unit module UI - module Tk # :nodoc: + module Tk # Runs a Test::Unit::TestSuite in a Tk UI. Obviously, # this one requires you to have Tk @@ -52,7 +50,7 @@ module Test end private - def setup_mediator # :nodoc: + def setup_mediator @mediator = TestRunnerMediator.new(@suite) suite_name = @suite.to_s if ( @suite.kind_of?(Module) ) @@ -61,7 +59,7 @@ module Test @suite_name_entry.value = suite_name end - def attach_to_mediator # :nodoc: + def attach_to_mediator @run_button.command(method(:run_test)) @fault_list.bind('ButtonPress-1', proc{|y| fault = @fault_detail_list[@fault_list.nearest(y)] @@ -81,7 +79,7 @@ module Test @runner.raise(@restart_signal) end - def start_ui # :nodoc: + def start_ui @viewer.run running = false begin @@ -101,11 +99,11 @@ module Test end end - def stop # :nodoc: + def stop ::Tk.exit end - def reset_ui(count) # :nodoc: + def reset_ui(count) @test_total_count = count.to_f @test_progress_bar.configure('background'=>'green') @test_progress_bar.place('relwidth'=>(count.zero? ? 0 : 0/count)) @@ -121,7 +119,7 @@ module Test clear_fault end - def add_fault(fault) # :nodoc: + def add_fault(fault) if ( ! @red ) @test_progress_bar.configure('background'=>'red') @red = true @@ -130,19 +128,19 @@ module Test @fault_list.insert('end', fault.short_display) end - def show_fault(fault) # :nodoc: + def show_fault(fault) raw_show_fault(fault.long_display) end - def raw_show_fault(string) # :nodoc: + def raw_show_fault(string) @detail_text.value = string end - def clear_fault # :nodoc: + def clear_fault raw_show_fault("") end - def result_changed(result) # :nodoc: + def result_changed(result) @test_count_label.value = result.run_count @test_progress_bar.place('relwidth'=>result.run_count/@test_total_count) @assertion_count_label.value = result.assertion_count @@ -150,7 +148,7 @@ module Test @error_count_label.value = result.error_count end - def started(result) # :nodoc: + def started(result) @result = result output_status("Started...") end @@ -163,11 +161,11 @@ module Test output_status("Finished in #{elapsed_time} seconds") end - def output_status(string) # :nodoc: + def output_status(string) @status_entry.value = string end - def setup_ui # :nodoc: + def setup_ui @status_entry = TkVariable.new l = TkLabel.new(nil, 'textvariable'=>@status_entry, 'relief'=>'sunken') l.pack('side'=>'bottom', 'fill'=>'x') @@ -243,7 +241,7 @@ module Test end end - def create_count_label(parent, label) # :nodoc: + def create_count_label(parent, label) TkLabel.new(parent, 'text'=>label).pack('side'=>'left', 'expand'=>true) v = TkVariable.new(0) TkLabel.new(parent, 'textvariable'=>v).pack('side'=>'left', 'expand'=>true) diff --git a/lib/test/unit/util/observable.rb b/lib/test/unit/util/observable.rb index f5066d3425..6d84539884 100644 --- a/lib/test/unit/util/observable.rb +++ b/lib/test/unit/util/observable.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -8,7 +6,7 @@ require 'test/unit/util/procwrapper' module Test module Unit - module Util # :nodoc: + module Util # This is a utility class that allows anything mixing # it in to notify a set of listeners about interesting @@ -80,7 +78,7 @@ module Test end private - def channels # :nodoc: + def channels @channels ||= {} return @channels end diff --git a/lib/test/unit/util/procwrapper.rb b/lib/test/unit/util/procwrapper.rb index fea66d7671..b341448e9c 100644 --- a/lib/test/unit/util/procwrapper.rb +++ b/lib/test/unit/util/procwrapper.rb @@ -1,5 +1,3 @@ -# :nodoc: -# # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. # License:: Ruby license. @@ -25,11 +23,11 @@ module Test @hash = a_proc.inspect.sub(/^(#<#{a_proc.class}:)/){''}.sub(/(>)$/){''}.hex end - def hash # :nodoc: + def hash return @hash end - def ==(other) # :nodoc: + def ==(other) case(other) when ProcWrapper return @a_proc == other.to_proc @@ -39,7 +37,7 @@ module Test end alias :eql? :== - def to_proc # :nodoc: + def to_proc return @a_proc end end