Setup RSpec to test a gem (not Rails)

后端 未结 4 860
野趣味
野趣味 2020-12-07 06:52

It is pretty easy with the added generator of rspec-rails to setup RSpec for testing a Rails application. But how about adding RSpec for testing a gem in development? I am n

4条回答
  •  盖世英雄少女心
    2020-12-07 07:15

    You can generate your new gem with rspec by running bundler gem --test=rspec my_gem. No additional Setup!

    I always forget this. It's implemented here: https://github.com/bundler/bundler/blob/33d2f67d56fe8bf00b0189c26125d27527ef1516/lib/bundler/cli/gem.rb#L36

提交回复
热议问题