25

The RubyGems Specification Reference says:

A collection of unit test files. They will be loaded as unit tests when the user requests a gem to be unit tested.

However there is no gem test command, and unlike the files config which is used in the packaging, I don't see any obvious place this is used. Google also seems not to turn up anything.

Is there any point for specifying test_files in a gem?

1 Answer 1

22

I've been trying to find an answer to this as well, and while I haven't turned up a definitive "don't use test_files" it seems that support has been somewhat deprecated.

From what I can tell, the answer to your question is "it depends". There are some points to specifying test_files, but they might not be what you expect/want:

  1. From a test perspective, rubygems doesn't seem to do anything as far as running the test files specified.
  2. From a packaging standpoint, they will be installed, which may or may not be useful for an end user.

Some references:

  • An open Issue #735 to not install test_files, deferred to a post-2.x RubyGems release due to 'backward compatibility'
  • Commit 429f88... in the RubyGems github repo, which removed code that tests gems (included back in v1.5.0)
  • A closed Bug #27507 to remove -t from gem install (it was removed after some discussion included in the bug)
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.