Search code examples
rubyrubygemsbundler

What are the practical advantages of using `add_development_dependency` in .gemspec?


..vs just listing gems used for the gem development in Gemfile (while everyone uses bundler anyway)..

..except for giving your fingers extra work?


Solution

  • It's not clear there is any.

    In theory, RubyGems has the information necessary to run tests with add_development_dependency and test_files (see this question).

    Some believe that this should be outside the scope of RubyGems (see this huge thread).

    In practice, there is currently no real advantage, and the fact that RubyGems still installs test files by default is a drawback, as might be the lack of flexibility that Gemfile offers.