Skip to content

Commit 7d35df3

Browse files
authored
Explicitly require helper in test_case (#1297)
Currently, the helper is required through the Rake test task, which is very implicit and means when running some tests directly some methods are not available. For example, running `bundle exec ruby -Itest PATH_TO_RDOC/test/rdoc/test_rdoc_comment.rb` will trigger `NoMethodError: undefined method 'assert_linear_performance' for an instance of RDocCommentTest` because `test/lib/helper.rb` is not required. This commit makes the test case always require the helper and remove the related options from the Rake test task.
1 parent 9b5ce6d commit 7d35df3

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Rakefile

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ end
3838
Rake::TestTask.new(:normal_test) do |t|
3939
t.verbose = true
4040
t.deps = :generate
41-
t.libs << "test/lib"
42-
t.ruby_opts << "-rhelper"
4341
t.test_files = FileList["test/**/test_*.rb"].exclude("test/rdoc/test_rdoc_rubygems_hook.rb")
4442
end
4543

test/rdoc/support/test_case.rb

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
require 'tmpdir'
1414
require 'stringio'
1515

16+
require_relative '../../lib/helper'
1617
require_relative '../../../lib/rdoc'
1718

1819
##

0 commit comments

Comments
 (0)