Skip to content

Commit bd928cb

Browse files
committed
Fix RSpec/DescribeClass
1 parent e02799c commit bd928cb

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ Naming/VariableNumber:
2222
- 'spec/grape/exceptions/validation_errors_spec.rb'
2323
- 'spec/grape/validations_spec.rb'
2424

25-
# Offense count: 1
26-
# Configuration parameters: IgnoredMetadata.
27-
RSpec/DescribeClass:
28-
Exclude:
29-
- '**/spec/features/**/*'
30-
- '**/spec/requests/**/*'
31-
- '**/spec/routing/**/*'
32-
- '**/spec/system/**/*'
33-
- '**/spec/views/**/*'
34-
- 'spec/grape/named_api_spec.rb'
35-
3625
# Offense count: 2
3726
# This cop supports unsafe autocorrection (--autocorrect-all).
3827
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.

spec/grape/named_api_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

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

66
let(:api) do
@@ -11,9 +11,11 @@
1111
end
1212
end
1313

14-
before { stub_const('NamedAPI', api) }
14+
let(:name) { 'NamedAPI'}
15+
16+
before { stub_const(name, api) }
1517

1618
it 'can access the name of the API' do
17-
expect(api_name).to eq 'NamedAPI'
19+
expect(api_name).to eq name
1820
end
1921
end

spec/grape/util/inheritable_setting_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,16 @@
221221
subject.namespace_reverse_stackable[:namespace_reverse_stackable_thing] = [:namespace_reverse_stackable_foo_bar]
222222
subject.route[:route_thing] = :route_foo_bar
223223
expect(subject.to_hash).to match(
224-
global: { global_thing: :global_foo_bar },
225-
namespace: { namespace_thing: :namespace_foo_bar },
226-
namespace_inheritable: {
227-
namespace_inheritable_thing: :namespace_inheritable_foo_bar
228-
},
229-
namespace_stackable: { namespace_stackable_thing: [:namespace_stackable_foo_bar, [:namespace_stackable_foo_bar]] },
230-
namespace_reverse_stackable:
231-
{ namespace_reverse_stackable_thing: [[:namespace_reverse_stackable_foo_bar], :namespace_reverse_stackable_foo_bar] },
232-
route: { route_thing: :route_foo_bar }
233-
)
224+
global: { global_thing: :global_foo_bar },
225+
namespace: { namespace_thing: :namespace_foo_bar },
226+
namespace_inheritable: {
227+
namespace_inheritable_thing: :namespace_inheritable_foo_bar
228+
},
229+
namespace_stackable: { namespace_stackable_thing: [:namespace_stackable_foo_bar, [:namespace_stackable_foo_bar]] },
230+
namespace_reverse_stackable:
231+
{ namespace_reverse_stackable_thing: [[:namespace_reverse_stackable_foo_bar], :namespace_reverse_stackable_foo_bar] },
232+
route: { route_thing: :route_foo_bar }
233+
)
234234
end
235235
end
236236
end

0 commit comments

Comments
 (0)