diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7cb16d6..a825012 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-04-06 14:14:58 UTC using RuboCop version 1.62.1. +# on 2024-08-03 08:32:56 UTC using RuboCop version 1.65.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -49,6 +49,7 @@ Metrics/BlockLength: # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS Naming/FileName: Exclude: + - 'Rakefile.rb' - 'lib/grape-swagger-rails.rb' - 'spec/features/grape-swagger-rails_spec.rb' @@ -61,7 +62,7 @@ RSpec/ContextWording: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: SkipBlocks, EnforcedStyle. +# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants. # SupportedStyles: described_class, explicit RSpec/DescribedClass: Exclude: @@ -70,14 +71,7 @@ RSpec/DescribedClass: # Offense count: 6 # Configuration parameters: CountAsOne. RSpec/ExampleLength: - Max: 8 - -# Offense count: 1 -# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. -# Include: **/*_spec*rb*, **/spec/**/* -RSpec/FilePath: - Exclude: - - 'spec/features/grape-swagger-rails_spec.rb' + Max: 12 # Offense count: 2 # Configuration parameters: AssignmentOnly. @@ -87,7 +81,7 @@ RSpec/InstanceVariable: # Offense count: 12 RSpec/MultipleExpectations: - Max: 4 + Max: 6 # Offense count: 2 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f102a..7ac8a19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ### 0.5.1 (Next) * Your contribution here. - +* [#120](https://github.com/ruby-grape/grape-swagger-rails/pull/120): Regenerate .rubocop_todo.yml - [@kakubin](https://github.com/kakubin). + ### 0.5.0 (2024/04/06) * [#110](https://github.com/ruby-grape/grape-swagger-rails/pull/110): Update dummy app to current rails conventions - [@duffn](https://github.com/duffn). diff --git a/Gemfile b/Gemfile index 08b55a0..25d6c30 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ group :development, :test do gem 'rubocop' gem 'rubocop-capybara' gem 'rubocop-rake' - gem 'rubocop-rspec' + gem 'rubocop-rspec', '>= 3.0.0' gem 'ruby-grape-danger', '~> 0.2.0', require: false gem 'selenium-webdriver' gem 'sprockets-rails', require: 'sprockets/railtie' diff --git a/spec/features/swagger_spec.rb b/spec/features/swagger_spec.rb index 788f667..e71bd78 100644 --- a/spec/features/swagger_spec.rb +++ b/spec/features/swagger_spec.rb @@ -51,7 +51,11 @@ find_by_id('endpointListTogger_headers', visible: true).click first('span[class="http_method"] a', visible: true).click click_button 'Try it out!' - expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header' + if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0') + expect(page).to have_css 'span.hljs-attr', text: 'x-test-header' + else + expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header' + end expect(page).to have_css 'span.hljs-string', text: 'Test Value' end @@ -59,9 +63,14 @@ find_by_id('endpointListTogger_headers', visible: true).click first('span[class="http_method"] a', visible: true).click click_button 'Try it out!' - expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header' + if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0') + expect(page).to have_css 'span.hljs-attr', text: 'x-test-header' + expect(page).to have_css 'span.hljs-attr', text: 'x-another-header' + else + expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header' + expect(page).to have_css 'span.hljs-attr', text: 'X-Another-Header' + end expect(page).to have_css 'span.hljs-string', text: 'Test Value' - expect(page).to have_css 'span.hljs-attr', text: 'X-Another-Header' expect(page).to have_css 'span.hljs-string', text: 'Another Value' end end @@ -108,7 +117,11 @@ find_by_id('endpointListTogger_headers', visible: true).click first('span[class="http_method"] a', visible: true).click click_button 'Try it out!' - expect(page).to have_css 'span.hljs-attr', text: 'Authorization' + if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0') + expect(page).to have_css 'span.hljs-attr', text: 'authorization' + else + expect(page).to have_css 'span.hljs-attr', text: 'Authorization' + end expect(page).to have_css 'span.hljs-string', text: "Basic #{Base64.encode64('username:password').strip}" end end @@ -127,7 +140,11 @@ find_by_id('endpointListTogger_headers', visible: true).click first('span[class="http_method"] a', visible: true).click click_button 'Try it out!' - expect(page).to have_css 'span.hljs-attr', text: 'Authorization' + if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0') + expect(page).to have_css 'span.hljs-attr', text: 'authorization' + else + expect(page).to have_css 'span.hljs-attr', text: 'Authorization' + end expect(page).to have_css 'span.hljs-string', text: 'Bearer token' end end @@ -146,7 +163,11 @@ find_by_id('endpointListTogger_headers', visible: true).click first('span[class="http_method"] a', visible: true).click click_button 'Try it out!' - expect(page).to have_css 'span.hljs-attr', text: 'Authorization' + if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0') + expect(page).to have_css 'span.hljs-attr', text: 'authorization' + else + expect(page).to have_css 'span.hljs-attr', text: 'Authorization' + end expect(page).to have_css 'span.hljs-string', text: 'Token token' end end