From ea8d9f590a9252f1bdb5d3484f8986a1de6aafea Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Fri, 11 Aug 2023 01:53:00 +0200 Subject: [PATCH] Fix rubocop validations (#251) --- Gemfile | 6 ++++++ cucumber-core.gemspec | 6 ------ lib/cucumber/core/event.rb | 2 +- spec/cucumber/core/test/doc_string_spec.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 167b3d8a..a7bf7663 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,12 @@ source "https://rubygems.org" gemspec +gem 'rake', '~> 13.0', '>= 13.0.6' +gem 'rspec', '~> 3.11', '>= 3.11.0' +gem 'rubocop', '~> 1.29', '>= 1.29.1' +gem 'rubocop-packaging', '~> 0.5', '>= 0.5.1' +gem 'unindent', '~> 1.0', '>= 1.0' + # To hack on Cucumber together with any of these libraries, uncomment the line below: # gem 'cucumber-gherkin', path: '../common/gherkin/ruby' # gem 'cucumber-messages', path: '../common/messages/ruby' diff --git a/cucumber-core.gemspec b/cucumber-core.gemspec index e56abdb5..cc863cc2 100644 --- a/cucumber-core.gemspec +++ b/cucumber-core.gemspec @@ -25,12 +25,6 @@ Gem::Specification.new do |s| s.add_dependency 'cucumber-messages', '>= 19', '< 22' s.add_dependency 'cucumber-tag-expressions', '~> 5.0', '>= 5.0.4' - s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6' - s.add_development_dependency 'rspec', '~> 3.11', '>= 3.11.0' - s.add_development_dependency 'rubocop', '~> 1.29', '>= 1.29.1' - s.add_development_dependency 'rubocop-packaging', '~> 0.5', '>= 0.5.1' - s.add_development_dependency 'unindent', '~> 1.0', '>= 1.0' - s.files = Dir[ 'CHANGELOG.md', 'CONTRIBUTING.md', diff --git a/lib/cucumber/core/event.rb b/lib/cucumber/core/event.rb index f46fc254..7274cde1 100644 --- a/lib/cucumber/core/event.rb +++ b/lib/cucumber/core/event.rb @@ -47,7 +47,7 @@ def event_id private def underscore(string) - string.to_s.gsub(/::/, '/'). + string.to_s.gsub('::', '/'). gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). gsub(/([a-z\d])([A-Z])/, '\1_\2'). tr("-", "_"). diff --git a/spec/cucumber/core/test/doc_string_spec.rb b/spec/cucumber/core/test/doc_string_spec.rb index 4ea24eee..054e0025 100644 --- a/spec/cucumber/core/test/doc_string_spec.rb +++ b/spec/cucumber/core/test/doc_string_spec.rb @@ -84,7 +84,7 @@ module Test end it 'delegates #gsub to the content string' do - expect( doc_string.gsub(/n/, '_') ).to eq 'co_te_t' + expect( doc_string.gsub('n', '_') ).to eq 'co_te_t' end it 'delegates #split to the content string' do