Skip to content

Commit

Permalink
[rubygems/rubygems] WIP: add test to run rubocop on the generated gem
Browse files Browse the repository at this point in the history
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

rubygems/rubygems@730b770f8a
  • Loading branch information
utkarsh2102 authored and hsbt committed Jul 15, 2020
1 parent cbe4d29 commit 449d242
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/bundler/commands/newgem_spec.rb
Expand Up @@ -173,6 +173,18 @@ def gem_skeleton_assertions
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
Expand Down

0 comments on commit 449d242

Please sign in to comment.