diff --git a/.rubocop.yml b/.rubocop.yml index 2e3569c..a3151a7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -389,6 +389,12 @@ Lint/RequireRangeParentheses: Lint/UselessRescue: Enabled: true +Lint/MixedCaseRange: + Enabled: true + +Lint/RedundantRegexpQuantifiers: + Enabled: true + Naming/BlockForwarding: Enabled: true @@ -446,6 +452,30 @@ Style/RedundantInitialize: Style/RedundantStringEscape: Enabled: true +Style/ExactRegexpMatch: + Enabled: true + +Style/RedundantArrayConstructor: + Enabled: true + +Style/RedundantCurrentDirectoryInPath: + Enabled: true + +Style/RedundantFilterChain: + Enabled: true + +Style/RedundantRegexpArgument: + Enabled: true + +Style/RedundantRegexpConstructor: + Enabled: true + +Style/ReturnNilInPredicateMethodDefinition: + Enabled: true + +Style/YAMLFileRead: + Enabled: true + RSpec/ExampleLength: Enabled: false @@ -497,12 +527,6 @@ RSpec/SubjectDeclaration: RSpec/VerifiedDoubleReference: Enabled: true -RSpec/FactoryBot/ConsistentParenthesesStyle: - Enabled: true - -RSpec/FactoryBot/SyntaxMethods: - Enabled: true - RSpec/Rails/AvoidSetupHook: Enabled: true @@ -518,9 +542,6 @@ RSpec/DuplicatedMetadata: RSpec/PendingWithoutReason: Enabled: true -RSpec/FactoryBot/FactoryNameStyle: - Enabled: true - RSpec/RedundantAround: Enabled: true @@ -533,6 +554,39 @@ RSpec/Rails/MinitestAssertions: RSpec/Rails/TravelAround: Enabled: true +RSpec/BeEmpty: + Enabled: true + +RSpec/ContainExactly: + Enabled: true + +RSpec/EmptyMetadata: + Enabled: true + +RSpec/Eq: + Enabled: true + +RSpec/IndexedLet: + Enabled: false + +RSpec/MatchArray: + Enabled: true + +RSpec/MetadataStyle: + Enabled: true + +RSpec/ReceiveMessages: + Enabled: true + +RSpec/SpecFilePathFormat: + Enabled: false + +RSpec/SpecFilePathSuffix: + Enabled: true + +RSpec/Rails/NegationBeValid: + Enabled: true + Capybara/NegationMatcher: Enabled: true @@ -547,3 +601,33 @@ Capybara/SpecificMatcher: Capybara/MatchStyle: Enabled: true + +Capybara/ClickLinkOrButtonStyle: + Enabled: true + +Capybara/RSpec/HaveSelector: + Enabled: true + +Capybara/RSpec/PredicateMatcher: + Enabled: true + +FactoryBot/ConsistentParenthesesStyle: + Enabled: true + +FactoryBot/SyntaxMethods: + Enabled: true + +FactoryBot/FactoryNameStyle: + Enabled: true + +FactoryBot/AssociationStyle: + Enabled: true + +FactoryBot/FactoryAssociationWithStrategy: + Enabled: true + +FactoryBot/IdSequence: + Enabled: true + +FactoryBot/RedundantFactoryOption: + Enabled: true diff --git a/spec/lib/health_monitor/configuration_spec.rb b/spec/lib/health_monitor/configuration_spec.rb index 10966b2..e6add2e 100644 --- a/spec/lib/health_monitor/configuration_spec.rb +++ b/spec/lib/health_monitor/configuration_spec.rb @@ -51,7 +51,7 @@ class CustomProvider < HealthMonitor::Providers::Base it 'accepts' do expect { subject.add_custom_provider(CustomProvider) - }.to change(subject, :providers).to(Array.new([CustomProvider])) + }.to change(subject, :providers).to([CustomProvider]) end it 'returns CustomProvider class' do diff --git a/spec/support/providers.rb b/spec/support/providers.rb index e102f55..4172cd2 100644 --- a/spec/support/providers.rb +++ b/spec/support/providers.rb @@ -46,8 +46,7 @@ def stub_sidekiq allow_any_instance_of(Sidekiq::Workers).to receive(:size).and_return(5) queue = instance_double(Sidekiq::Queue) - allow(queue).to receive(:latency).and_return(5) - allow(queue).to receive(:size).and_return(5) + allow(queue).to receive_messages(latency: 5, size: 10) allow(Sidekiq::Queue).to receive(:new).and_return(queue) retry_set = instance_double(Sidekiq::RetrySet)