From 95fff9cb7278636732587f8b9de8d7f1101af4cb Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Sun, 5 May 2024 01:16:25 +0100 Subject: [PATCH] Autocorrect rubocop offenses --- Rakefile | 2 +- shelp.gemspec | 12 ++++++------ spec/shelp_spec.rb | 8 ++------ spec/spec_helper.rb | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Rakefile b/Rakefile index cca7175..23e0614 100644 --- a/Rakefile +++ b/Rakefile @@ -9,4 +9,4 @@ require "rubocop/rake_task" RuboCop::RakeTask.new -task default: %i[spec rubocop] +task default: [:spec, :rubocop] diff --git a/shelp.gemspec b/shelp.gemspec index 84e7b7c..3f6e382 100644 --- a/shelp.gemspec +++ b/shelp.gemspec @@ -23,13 +23,13 @@ Gem::Specification.new do |spec| # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. gemspec = File.basename(__FILE__) - spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls| - ls.readlines("\x0", chomp: true).reject do |f| - (f == gemspec) || - f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile]) || - f.end_with?('.gem') + spec.files = IO.popen(["git", "ls-files", "-z"], chdir: __dir__, err: IO::NULL) do |ls| + ls.readlines("\x0", chomp: true).reject do |f| + (f == gemspec) || + f.start_with?("bin/", "test/", "spec/", "features/", ".git", ".github", "appveyor", "Gemfile") || + f.end_with?(".gem") + end end -end spec.bindir = "exe" spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] diff --git a/spec/shelp_spec.rb b/spec/shelp_spec.rb index cd3fba1..da6467f 100644 --- a/spec/shelp_spec.rb +++ b/spec/shelp_spec.rb @@ -1,11 +1,7 @@ # frozen_string_literal: true -RSpec.describe Shelp do +RSpec.describe(Shelp) do it "has a version number" do - expect(Shelp::VERSION).not_to be nil - end - - it "does something useful" do - expect(true).to eq(true) + expect(Shelp::VERSION).not_to(be(nil)) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7a11f82..3513091 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,7 +9,7 @@ # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! - config.expect_with :rspec do |c| + config.expect_with(:rspec) do |c| c.syntax = :expect end end