Skip to content

Commit

Permalink
Merge pull request #321 from sue445/upgrade_rubocop
Browse files Browse the repository at this point in the history
Upgrade to latest rubocop gems
  • Loading branch information
sue445 authored Dec 25, 2024
2 parents 19ce08e + d0796fb commit eac3c9b
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ AllCops:
- 'vendor/**/*'
- '.git/**/*'

Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec

Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
Expand Down
2 changes: 1 addition & 1 deletion examples/maho_girls.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "rubicure"
require_relative "./common"
require_relative "common"

code = <<-RUBY
puts Precure.maho_girls.title
Expand Down
2 changes: 1 addition & 1 deletion examples/tropical_rouge.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "rubicure"
require_relative "./common"
require_relative "common"

code = <<~RUBY
@manatsu = Cure.summer
Expand Down
2 changes: 1 addition & 1 deletion lib/rubicure/cure_cosmo.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Cure
module CosmoExt
def transform!(style = nil)
return super(style) unless style == :rainbow_perfume
return super unless style == :rainbow_perfume

humanize!

Expand Down
2 changes: 1 addition & 1 deletion lib/rubicure/girl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def colors
end

colors.each do |color|
define_method "#{color}?" do
define_method :"#{color}?" do
self.color.to_sym == color
end
end
Expand Down
9 changes: 4 additions & 5 deletions rubicure.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
end

spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency "activesupport", ">= 5.0.0"
Expand All @@ -43,11 +42,11 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec-collection_matchers"
spec.add_development_dependency "rspec-its"
spec.add_development_dependency "rspec-parameterized", ">= 0.3.2"
spec.add_development_dependency "rubocop", "1.24.0"
spec.add_development_dependency "rubocop", "1.69.2"
spec.add_development_dependency "rubocop_auto_corrector"
spec.add_development_dependency "rubocop-performance", "1.9.2"
spec.add_development_dependency "rubocop-rake", "0.5.1"
spec.add_development_dependency "rubocop-rspec", "2.1.0"
spec.add_development_dependency "rubocop-performance", "1.23.0"
spec.add_development_dependency "rubocop-rake", "0.6.0"
spec.add_development_dependency "rubocop-rspec", "3.3.0"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "term-ansicolor", "!= 1.11.1" # ref. https://github.com/flori/term-ansicolor/issues/41
spec.add_development_dependency "unparser", ">= 0.4.5"
Expand Down
8 changes: 3 additions & 5 deletions spec/config/girls_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@
subject { transform_calls }

transform_calls.count.times do |n|
# rubocop:disable RSpec/RepeatedDescription `expect().not_to all( matcher )` is not supported.
its([n]) { should_not be_start_with "precure_" }
its([n]) { should_not be_end_with "_precure" }
its([n]) { should_not be_end_with "!" }
# rubocop:enable RSpec/RepeatedDescription
its([n]) { should_not start_with "precure_" }
its([n]) { should_not end_with "_precure" }
its([n]) { should_not end_with "!" }
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/rubicure/core_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
].map(&:girl_name)
end

it { should contain_exactly(*dream_stars_girl_names) }
it { should match_array(dream_stars_girl_names) }
end

describe "#super_stars" do
Expand All @@ -158,7 +158,7 @@
].map(&:girl_name)
end

it { should contain_exactly(*super_stars_girl_names) }
it { should match_array(super_stars_girl_names) }
end

describe "#miracle_universe" do
Expand All @@ -184,7 +184,7 @@
].map(&:girl_name)
end

it { should contain_exactly(*miracle_universe_girl_names) }
it { should match_array(miracle_universe_girl_names) }
end

describe "#miracle_leap" do
Expand All @@ -208,6 +208,6 @@
].map(&:girl_name)
end

it { should contain_exactly(*miracle_leap_girl_names) }
it { should match_array(miracle_leap_girl_names) }
end
end
6 changes: 3 additions & 3 deletions spec/rubicure/girl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
]
end

it { should contain_exactly(*expected) }
it { should match_array(expected) }
end

describe "dynamic color methods" do
Expand Down Expand Up @@ -367,13 +367,13 @@
describe "#heisei?" do
subject { girl.heisei? }

it { should eq true }
it { should be true }
end

describe "#reiwa?" do
subject { girl.reiwa? }

# TODO: Add reiwa precure test after cure cosmo is added
it { should eq false }
it { should be false }
end
end
2 changes: 1 addition & 1 deletion spec/rubicure/rubicure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

with_them do
it { expect(Cure.send(name)).to be_an_instance_of Rubicure::Girl }
it { expect(Cure.send(name).precure_name).to be_start_with "キュア" }
it { expect(Cure.send(name).precure_name).to start_with "キュア" }
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/rubicure/series_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

let(:json) do
<<~JSON
{\"series_name\":\"splash_star\",\"title\":\"ふたりはプリキュア Splash☆Star\",\"started_date\":\"2006-02-05\",\"ended_date\":\"2007-01-28\",\"girls\":[\"cure_bloom\",\"cure_egret\"]}
{"series_name":"splash_star","title":"ふたりはプリキュア Splash☆Star","started_date":"2006-02-05","ended_date":"2007-01-28","girls":["cure_bloom","cure_egret"]}
JSON
end

Expand Down

0 comments on commit eac3c9b

Please sign in to comment.