Project

General

Profile

Actions

Feature #4918

closed

Make all core tests inherit from Test::Unit::TestCase

Added by MartinBosslet (Martin Bosslet) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
[ruby-core:37289]

Description

Some tests for OpenSSL inherited from Minitest::Unit::TestCase instead of
Test::Unit::TestCase. To be consistent, all tests should probably inherit from
Test::Unit::TestCase (cf. [ruby-core:37275]).

I would scan through all tests in Ruby core and replace direct Minitest references
except where absolutely required (rubygems, rdoc).

Please let me know if there are other cases where the direct reference to Minitest
is mandatory.

Regards,
Martin

Updated by Eregon (Benoit Daloze) over 13 years ago

Hello,

On 22 June 2011 07:46, Martin Bosslet wrote:

Some tests for OpenSSL inherited from Minitest::Unit::TestCase instead of
Test::Unit::TestCase. To be consistent, all tests should probably inherit from
Test::Unit::TestCase (cf. [ruby-core:37275]).

I believe some tests using MiniTest are intended to do so.

If it's just a few using MiniTest against a lot using Test for a
particular library, it might be interesting to normalize, but I think
it is fine as is too.

Remember they are not drop-in replacement, notably MiniTest run the
tests in random order.

I would scan through all tests in Ruby core and replace direct Minitest references
except where absolutely required (rubygems, rdoc).

Please let me know if there are other cases where the direct reference to Minitest
is mandatory.

A quick ack -l --invert-file-match -G 'rdoc|rubygems' MiniTest test gives:
test/benchmark/test_benchmark.rb
This is using MiniTest::Spec, and it is intended.

test/fiddle/helper.rb
This affects all Fiddle tests, not sure it should change

test/minitest/test_minitest_benchmark.rb
test/minitest/test_minitest_mock.rb
test/minitest/test_minitest_spec.rb
test/minitest/test_minitest_unit.rb
Of course, MiniTest's own tests are written using itself

test/net/smtp/test_response.rb
test/net/smtp/test_smtp.rb
test/net/smtp/test_ssl_socket.rb
Can likely be changed, especially since other tests from net/ are using Test

test/profile_test_all.rb
Can not be changed, used for profiling

test/psych/helper.rb
This affects all Psych tests, it should not change.
It's Aaron's decision whether to use MiniTest

test/psych/test_to_yaml_properties.rb
Should probably use the Psych::TestCase instead of MiniTest::Unit::TestCase

test/runner.rb
It's for "class Gem::TestCase < MiniTest::Unit::TestCase". So, for rubygems.
I think it should be in some helper file rather than in runner.rb

test/syck/test_struct.rb
Should likely be changed

test/testunit/test_rake_integration.rb
test/testunit/tests_for_parallel/misc.rb
I think the references to MiniTest are intended, these tests being
about integration of MiniTest and Test.

--

To Rubygems maintainers:
Why is Gem::TestCase defined in test/runner.rb rather than some helper
file in test/rubygems ?

Hope it helps,
B.D.

Updated by drbrain (Eric Hodel) over 13 years ago

On Jun 22, 2011, at 5:41 AM, Benoit Daloze wrote:

On 22 June 2011 07:46, Martin Bosslet wrote:

Some tests for OpenSSL inherited from Minitest::Unit::TestCase instead of
Test::Unit::TestCase. To be consistent, all tests should probably inherit from
Test::Unit::TestCase (cf. [ruby-core:37275]).

I believe some tests using MiniTest are intended to do so.

If it's just a few using MiniTest against a lot using Test for a
particular library, it might be interesting to normalize, but I think
it is fine as is too.

Remember they are not drop-in replacement, notably MiniTest run the
tests in random order.

I would scan through all tests in Ruby core and replace direct Minitest references
except where absolutely required (rubygems, rdoc).

Please let me know if there are other cases where the direct reference to Minitest
is mandatory.

A quick ack -l --invert-file-match -G 'rdoc|rubygems' MiniTest test gives:

test/runner.rb
It's for "class Gem::TestCase < MiniTest::Unit::TestCase". So, for rubygems.
I think it should be in some helper file rather than in runner.rb

To Rubygems maintainers:
Why is Gem::TestCase defined in test/runner.rb rather than some helper
file in test/rubygems ?

Gem::TestCase is defined in lib/rubygems/test_case.rb (for reuse by RubyGems plugins and extensions). I imagine it is also defined in test/runner.rb to fix some problem when loading the combined test suite.

test/testunit/test_rake_integration.rb
test/testunit/tests_for_parallel/misc.rb
I think the references to MiniTest are intended, these tests being
about integration of MiniTest and Test.

I've been working on brining rake 0.9.2 into ruby trunk and it will switch to MiniTest::Unit::TestCase

Updated by MartinBosslet (Martin Bosslet) over 13 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Benoit Daloze wrote:

A quick ack -l --invert-file-match -G 'rdoc|rubygems' MiniTest test gives:
test/benchmark/test_benchmark.rb
...

Thanks for the analysis, Benoit! As I don't want to fiddle around in other people's domains anyway, I suppose it's fine to agree that it's under the respective maintainers' sovereignty to ensure consistency regarding this issue?

I close this issue then, just wanted to point it out and gain some insight about the underlying philosophy. Thanks for your contribution!

Regards,
Martin

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0