Skip to content

Commit

Permalink
Fix RSpec/DescribeClass
Browse files Browse the repository at this point in the history
  • Loading branch information
ericproulx committed Oct 6, 2024
1 parent e02799c commit bd928cb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
11 changes: 0 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ Naming/VariableNumber:
- 'spec/grape/exceptions/validation_errors_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- '**/spec/features/**/*'
- '**/spec/requests/**/*'
- '**/spec/routing/**/*'
- '**/spec/system/**/*'
- '**/spec/views/**/*'
- 'spec/grape/named_api_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
Expand Down
8 changes: 5 additions & 3 deletions spec/grape/named_api_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

describe 'A named API' do
describe Grape::API do
subject(:api_name) { NamedAPI.endpoints.last.options[:for].to_s }

let(:api) do
Expand All @@ -11,9 +11,11 @@
end
end

before { stub_const('NamedAPI', api) }
let(:name) { 'NamedAPI'}

before { stub_const(name, api) }

it 'can access the name of the API' do
expect(api_name).to eq 'NamedAPI'
expect(api_name).to eq name
end
end
20 changes: 10 additions & 10 deletions spec/grape/util/inheritable_setting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,16 @@
subject.namespace_reverse_stackable[:namespace_reverse_stackable_thing] = [:namespace_reverse_stackable_foo_bar]
subject.route[:route_thing] = :route_foo_bar
expect(subject.to_hash).to match(
global: { global_thing: :global_foo_bar },
namespace: { namespace_thing: :namespace_foo_bar },
namespace_inheritable: {
namespace_inheritable_thing: :namespace_inheritable_foo_bar
},
namespace_stackable: { namespace_stackable_thing: [:namespace_stackable_foo_bar, [:namespace_stackable_foo_bar]] },
namespace_reverse_stackable:
{ namespace_reverse_stackable_thing: [[:namespace_reverse_stackable_foo_bar], :namespace_reverse_stackable_foo_bar] },
route: { route_thing: :route_foo_bar }
)
global: { global_thing: :global_foo_bar },
namespace: { namespace_thing: :namespace_foo_bar },
namespace_inheritable: {
namespace_inheritable_thing: :namespace_inheritable_foo_bar
},
namespace_stackable: { namespace_stackable_thing: [:namespace_stackable_foo_bar, [:namespace_stackable_foo_bar]] },
namespace_reverse_stackable:
{ namespace_reverse_stackable_thing: [[:namespace_reverse_stackable_foo_bar], :namespace_reverse_stackable_foo_bar] },
route: { route_thing: :route_foo_bar }
)
end
end
end

0 comments on commit bd928cb

Please sign in to comment.