rubocop-extension-generator icon indicating copy to clipboard operation
rubocop-extension-generator copied to clipboard

Duplication of gem 'rspec'

Open r7kamura opened this issue 3 years ago • 1 comments

The Gemfile generated by bundle gem may already contain the gem 'rspec'. (This depends on BUNDLE_GEM__TEST)

In that case, the following error will occur:

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: rspec (~> 3.0) and rspec (>= 0). Bundler cannot continue.

 #  from /path/to/Gemfile:13
 #  -------------------------------------------
 #  gem "rubocop", "~> 1.21"
 >  gem 'rspec'
 #  -------------------------------------------

https://github.com/rubocop/rubocop-extension-generator/blob/eb0bc98d8ac189d48a6c5acb55e487aeab72139e/lib/rubocop/extension/generator/generator.rb#L136-L138

I think the expected behavior is not to add it if gem 'rspec', ... is already included.

r7kamura avatar Feb 22 '22 20:02 r7kamura

I just noticed that https://github.com/rubocop/rubocop-extension-generator/pull/10 exists.

r7kamura avatar Jul 11 '22 05:07 r7kamura