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?
It means "equal to or greater than in the last digit", so e.g. ~> 2.3 means "equal to 2.3 or greater than 2.3, but less than 3.0", while ~> 2.3.
The gemspec defines what's in the gem, who made it, and the version of the gem. It's also your interface to RubyGems.org. All of the information you see on a gem page (like jekyll's) comes from the gemspec. Once your gemspec file is sorted out you build it to assemble your gem.
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:
Some references:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With