[前][次][番号順一覧][スレッド一覧]

ruby-changes:62227

From: Utkarsh <ko1@a...>
Date: Wed, 15 Jul 2020 16:05:42 +0900 (JST)
Subject: [ruby-changes:62227] 449d24200b (master): [rubygems/rubygems] WIP: add test to run rubocop on the generated gem

https://git.ruby-lang.org/ruby.git/commit/?id=449d24200b

From 449d24200b94ac5d849314125d2930e04d20ee6e Mon Sep 17 00:00:00 2001
From: Utkarsh Gupta <utkarsh@d...>
Date: Fri, 19 Jun 2020 22:14:21 +0530
Subject: [rubygems/rubygems] WIP: add test to run rubocop on the generated gem

Signed-off-by: Utkarsh Gupta <utkarsh@d...>

https://github.com/rubygems/rubygems/commit/730b770f8a

diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb
index b3dc511..91e33bd 100644
--- a/spec/bundler/commands/newgem_spec.rb
+++ b/spec/bundler/commands/newgem_spec.rb
@@ -173,6 +173,18 @@ RSpec.describe "bundle gem" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/newgem_spec.rb#L173
     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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]