From 480779b33992bcf479183791c0dd1102789b46bc Mon Sep 17 00:00:00 2001 From: Andrew Sullivan Cant Date: Fri, 25 Nov 2022 23:54:31 -0500 Subject: [PATCH] Enable New Rubocops cops and update offences --- .rubocop.yml | 3 ++- lib/rspec/tabular.rb | 2 +- rspec-tabular.gemspec | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8444f3c..78f0948 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,8 +2,9 @@ require: rubocop-rspec AllCops: TargetRubyVersion: 2.6 + NewCops: enable -Metrics/LineLength: +Layout/LineLength: Max: 100 Metrics/MethodLength: diff --git a/lib/rspec/tabular.rb b/lib/rspec/tabular.rb index 0be6df1..9859b97 100644 --- a/lib/rspec/tabular.rb +++ b/lib/rspec/tabular.rb @@ -106,7 +106,7 @@ def it_with(*input_values, &block) block = proc { is_expected.to eq(expected_value) } end - context("with #{Hash[metadata[:inputs].zip input_values]}") do + context("with #{metadata[:inputs].zip(input_values).to_h}") do metadata[:inputs].each_index do |i| key = metadata[:inputs][i] value = input_values[i] diff --git a/rspec-tabular.gemspec b/rspec-tabular.gemspec index b89b5af..92456f4 100644 --- a/rspec-tabular.gemspec +++ b/rspec-tabular.gemspec @@ -18,12 +18,13 @@ Gem::Specification.new do |spec| spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features)/}) end - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] spec.required_ruby_version = '>= 2.6.0' + spec.metadata['rubygems_mfa_required'] = 'true' + spec.add_runtime_dependency 'rspec-core', '>= 2.99.0' spec.add_development_dependency 'bundler', '~> 1.7'