Skip to content

Commit

Permalink
Add Yard configuration and correct Yard syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomthom committed Feb 27, 2024
1 parent b5a28cd commit e94114c
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,10 @@ Gemfile.lock

src/testup/ui/js/*.*
src/testup/ui/images/*

############
## Yard
############

.yardoc/
doc/
7 changes: 7 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--title "TestUp 2 for SketchUp - A GUI wrapper for running Minitest in SketchUp"
--no-private
--markup markdown
src/**/*.rb
-
README.md
LICENSE
2 changes: 1 addition & 1 deletion src/testup/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def self.run_test_suite(test_suite, options: {})
# @param [String] title
# @param [String] path
# @param [Array<Hash>] results
# @result [Report::TestSuite]
# @return [Report::TestSuite]
def self.test_suite_from_results(title, path, results)
tests = {}
results.each { |result|
Expand Down
2 changes: 1 addition & 1 deletion src/testup/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module TestUp
# return a UI::Command object. So instead this module is used that will extend
# the instance created with it's #create method.
#
# @example
# @example Creating a Command object:
# cmd = Command.create('Hello World') {
# Extension.hello_world
# }
Expand Down
2 changes: 1 addition & 1 deletion src/testup/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def self.toggle_verbose_console_tests
end

# TODO(thomthom): Move this method. Maybe to the Reporter class if the
# @num_tests_being_run instance variable also can be moved there.
# `@num_tests_being_run`` instance variable also can be moved there.
def self.update_testing_progress(num_tests_run)
progress = TaskbarProgress.new
progress.set_value(num_tests_run, @num_tests_being_run)
Expand Down
2 changes: 1 addition & 1 deletion src/testup/coverage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module TestUp
# TODO: Rename to CoverageDiscoverer
class Coverage

# @param [String] settings_id
# @param [String] testsuite_path
def initialize(testsuite_path)
unless File.directory?(testsuite_path)
raise ArgumentError, "Not a valid directory: #{testsuite_path}"
Expand Down
2 changes: 1 addition & 1 deletion src/testup/coverage_discoverer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def report(discovered_suite)

private

# @param [Array<Report::TestCase>] expected
# @param [Array<Report::TestCase>] expected_test_case
# @param [Array<Report::TestCase>] missing
# @return [Float]
def compute_percentage(expected_test_case, missing)
Expand Down
2 changes: 1 addition & 1 deletion src/testup/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def self.set_tracing(category, enabled)
end

# @param [Symbol] category
# @param [Boolean]
# @return [Boolean]
def self.tracing(category)
@trace[category] || false
end
Expand Down
2 changes: 1 addition & 1 deletion src/testup/manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Manifest

attr_reader :filename

# @param [String] filename
# @param [String] manifest_filename
def initialize(manifest_filename)
@filename = manifest_filename
@expected = parse_manifest(manifest_filename)
Expand Down
2 changes: 1 addition & 1 deletion src/testup/report/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module TestUp
module Report
class Collection < SortedSet

# @param [Integer, #hash]
# @param [Integer, #hash] value
def [](value)
# return @hash.keys[value] if value.is_a?(Integer)
return each.to_a[value] if value.is_a?(Integer)
Expand Down
2 changes: 1 addition & 1 deletion src/testup/report/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def hash
@id.hash
end

# @param [Report::Test]
# @param [Report::Test] test
# @return [Boolean]
def merge_result(test)
return false if test.result.nil?
Expand Down
2 changes: 1 addition & 1 deletion src/testup/report/test_coverage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.from_hash(hash)
end

# @param [Float] percent
# @param [Hash, Array<Report::TestCase>]
# @param [Hash, Array<Report::TestCase>] missing
def initialize(percent, missing)
@percent = percent.to_f
@missing = restructure(missing)
Expand Down
4 changes: 2 additions & 2 deletions src/testup/report/test_suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ def rediscover(other_test_suite)
self
end

# @param [Report::TestCase, Symbol, String]
# @param [Report::TestCase, Symbol, String] test_case
# @return [Report::TestCase]
def test_case(test_case)
@test_cases[test_case]
end
alias_method :[], :test_case

# @param [Report::TestCase, String]
# @param [Report::TestCase, String] test_case
def test_case?(test_case)
!test_case(test_case).nil?
end
Expand Down
2 changes: 1 addition & 1 deletion src/testup/sketchup_test_utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def assert_no_notification
end

# @param [String] event
# @param [Integer] argument
# @param [Integer] argument_index
# @param [Class] type
# @param [Object] expected
def assert_callback_data(event, argument_index, type, expected)
Expand Down
2 changes: 1 addition & 1 deletion src/testup/test_discoverer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def discover_testcases(testsuite_path)
}
end

# @param [Array<String>] testsuite_paths
# @param [Array<String>] testsuite_path
# @return [Array<String>] Path to all test case files found.
def discover_testcase_source_files(testsuite_path)
# Log.debug ">>> #{self.class}.discover_testcase_source_files(...)"
Expand Down
2 changes: 1 addition & 1 deletion src/testup/ui/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def discover_tests
nil
end

# @param [Report::TestSuite] test_suite
# @param [Report::TestSuite] test_suites
# @return [nil]
def rediscover_tests(test_suites)
Log.trace :discover, "rediscover_tests(...)"
Expand Down

0 comments on commit e94114c

Please sign in to comment.