ruby-on-railsrubybundlerminitestgem-bundler

How to generate 'minitest/spec' based gems via bundler?


bundle gem gem_name --test=minitest

allows for choosing minitest, but how to make bundler generate code for minitest/spec instead of minitest/test.


Solution

  • It is not currently possible.

     -t, --test=minitest, --test=rspec
    

    Specify the test framework that Bundler should use when generating the project. Acceptable values are minitest and rspec. The GEM_NAME.gemspec will be configured and a skeleton test/spec directory will be created based on this option. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future bundle gem use.

    However the bundle gem generator generates less than 10 lines of tests, so converting to MiniTest::Spec is hardly a herculean task.