diff options
author | Utkarsh Gupta <utkarsh@debian.org> | 2020-06-19 22:14:21 +0530 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-07-15 16:05:12 +0900 |
commit | 449d24200b94ac5d849314125d2930e04d20ee6e (patch) | |
tree | 3a5626d83d3404c2c485bdcd68a5e7d7548335df /spec | |
parent | cbe4d29c2da9913c77289cdaf9d949a7c24154c5 (diff) | |
download | ruby-449d24200b94ac5d849314125d2930e04d20ee6e.tar.gz |
[rubygems/rubygems] WIP: add test to run rubocop on the generated gem
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
https://github.com/rubygems/rubygems/commit/730b770f8a
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/commands/newgem_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index b3dc511f58..91e33bd2b9 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -173,6 +173,18 @@ RSpec.describe "bundle gem" do it "generates a default .rubocop.yml" do expect(bundled_app("#{gem_name}/.rubocop.yml")).to exist end + + it "run rubocop inside the generated gem with no offenses" do + prepare_gemspec(bundled_app("#{gem_name}", "#{gem_name}.gemspec")) + + gems = ["rubocop"] + path = Bundler.feature_flag.default_install_uses_path? ? local_gem_path(:base => bundled_app("#{gem_name}")) : system_gem_path + realworld_system_gems gems, :path => path + bundle "install", :dir => bundled_app("#{gem_name}") + bundle "exec rubocop", :dir => bundled_app("#{gem_name}") + + expect($?.exitstatus).to eq(0) if exitstatus + end end shared_examples_for "--no-rubocop flag" do |