Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSpec/ExampleWording-20240207233131 #913

Merged
merged 5 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 15 additions & 40 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 200`
# on 2023-10-11 12:02:42 UTC using RuboCop version 1.57.0.
# `rubocop --auto-gen-config --exclude-limit 180`
# on 2024-02-07 23:32:02 UTC using RuboCop version 1.60.2.
# 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
Expand Down Expand Up @@ -154,7 +154,7 @@ Layout/EmptyLineBetweenDefs:
- 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb'
- 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb'

# Offense count: 56
# Offense count: 55
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLines:
Exclude:
Expand Down Expand Up @@ -192,7 +192,7 @@ Layout/EmptyLinesAroundAttributeAccessor:
Exclude:
- 'lib/apipie/configuration.rb'

# Offense count: 92
# Offense count: 91
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Expand All @@ -213,7 +213,6 @@ Layout/EmptyLinesAroundBlockBody:
- 'spec/lib/apipie/extractor/writer_spec.rb'
- 'spec/lib/apipie/file_handler_spec.rb'
- 'spec/lib/apipie/generator/swagger/param_description/composite_spec.rb'
- 'spec/lib/apipie/generator/swagger/param_description/type_spec.rb'
- 'spec/lib/apipie/param_description_spec.rb'
- 'spec/lib/apipie/param_group_spec.rb'
- 'spec/lib/apipie/validator_spec.rb'
Expand Down Expand Up @@ -454,7 +453,7 @@ Layout/SpaceAfterColon:
Exclude:
- 'spec/dummy/app/controllers/included_param_group_controller.rb'

# Offense count: 42
# Offense count: 41
# This cop supports safe autocorrection (--autocorrect).
Layout/SpaceAfterComma:
Exclude:
Expand Down Expand Up @@ -490,8 +489,9 @@ Layout/SpaceAfterNot:

# Offense count: 142
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
# SupportedStylesForExponentOperator: space, no_space
# SupportedStylesForRationalLiterals: space, no_space
Layout/SpaceAroundOperators:
Exclude:
- 'app/controllers/apipie/apipies_controller.rb'
Expand Down Expand Up @@ -726,21 +726,18 @@ Lint/UnderscorePrefixedVariableName:
- 'lib/apipie/application.rb'
- 'lib/apipie/dsl_definition.rb'

# Offense count: 26
# Offense count: 22
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- 'lib/apipie/configuration.rb'
- 'lib/apipie/extractor/collector.rb'
- 'lib/apipie/extractor/recorder.rb'
- 'lib/apipie/param_description.rb'
- 'lib/apipie/resource_description.rb'
- 'lib/apipie/rspec/response_validation_helper.rb'
- 'lib/tasks/apipie.rake'
- 'spec/controllers/users_controller_spec.rb'
- 'spec/lib/apipie/apipies_controller_spec.rb'
- 'spec/lib/apipie/extractor_spec.rb'
- 'spec/lib/swagger/swagger_dsl_spec.rb'
- 'spec/spec_helper.rb'

Expand Down Expand Up @@ -802,7 +799,7 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Max: 119

# Offense count: 4
# Offense count: 5
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
MaxOptionalParameters: 5
Expand Down Expand Up @@ -974,7 +971,7 @@ RSpec/BeforeAfterAll:
Exclude:
- 'spec/controllers/users_controller_spec.rb'

# Offense count: 53
# Offense count: 54
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand Down Expand Up @@ -1052,28 +1049,6 @@ RSpec/EmptyLineAfterHook:
RSpec/ExampleLength:
Max: 85

# Offense count: 159
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
# DisallowedExamples: works
RSpec/ExampleWording:
Exclude:
- 'spec/controllers/api/v1/architectures_controller_spec.rb'
- 'spec/controllers/api/v2/nested/resources_controller_spec.rb'
- 'spec/controllers/concerns_controller_spec.rb'
- 'spec/controllers/extended_controller_spec.rb'
- 'spec/controllers/included_param_group_controller_spec.rb'
- 'spec/controllers/users_controller_spec.rb'
- 'spec/lib/apipie/application_spec.rb'
- 'spec/lib/apipie/extractor/writer_spec.rb'
- 'spec/lib/apipie/method_description_spec.rb'
- 'spec/lib/apipie/param_description_spec.rb'
- 'spec/lib/apipie/param_group_spec.rb'
- 'spec/lib/apipie/resource_description_spec.rb'
- 'spec/lib/apipie/validator_spec.rb'
- 'spec/lib/swagger/swagger_dsl_spec.rb'
- 'spec/test_engine/memes_controller_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExcessiveDocstringSpacing:
Expand Down Expand Up @@ -1141,7 +1116,7 @@ RSpec/MessageSpies:
RSpec/MultipleExpectations:
Max: 19

# Offense count: 160
# Offense count: 163
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 15
Expand All @@ -1166,7 +1141,7 @@ RSpec/NamedSubject:
- 'spec/lib/swagger/rake_swagger_spec.rb'
- 'spec/lib/swagger/swagger_dsl_spec.rb'

# Offense count: 96
# Offense count: 97
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 6
Expand Down Expand Up @@ -1293,7 +1268,7 @@ Rails/NegateInclude:
- 'lib/apipie/extractor/writer.rb'
- 'spec/spec_helper.rb'

# Offense count: 7
# Offense count: 6
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
Expand Down Expand Up @@ -1921,7 +1896,7 @@ Style/StringConcatenation:
- 'lib/apipie/application.rb'
- 'lib/apipie/extractor/writer.rb'

# Offense count: 1214
# Offense count: 1231
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Expand Down Expand Up @@ -2021,7 +1996,7 @@ Style/TrailingCommaInArrayLiteral:
- 'spec/controllers/users_controller_spec.rb'
- 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb'

# Offense count: 4
# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/api/v1/architectures_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe "resource description" do
subject { Apipie.get_resource_description(Api::V1::ArchitecturesController, "1.0") }

it "should be version 1.0" do
it "is version 1.0" do
expect(subject._version).to eq('1.0')

expect(Apipie.resource_descriptions['1.0'].size).to eq(2)
Expand All @@ -14,11 +14,11 @@
context "there is another version" do
let(:v2) { archv2 = Apipie.get_resource_description(Api::V2::ArchitecturesController, "2.0") }

it "should have unique doc url" do
it "has unique doc url" do
expect(subject.doc_url).not_to eq(v2.doc_url)
end

it "should have unique methods" do
it "has unique methods" do
expect(subject._methods.keys).to include(:index)
expect(v2._methods.keys).to include(:index)
expect(subject._methods[:index]).not_to eq(v2._methods[:index])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
describe '.get_resource_id' do
subject { Apipie.get_resource_id(Api::V2::Nested::ResourcesController) }

it "should have resource_id set" do
it "has resource_id set" do
expect(subject).to eq("resource")
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/concerns_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
expect(Apipie["concern_resources#show"]).to be
end

it "should reply to valid request" do
it "replies to valid request" do
get :show, :params => { :id => '5' }, :session => { :user_id => "secret_hash" }
assert_response :success
end

it "should pass if required parameter is missing" do
it "passes if required parameter is missing" do
expect { get :show, :params => { :id => '5' } }.not_to raise_error
end

Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/extended_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

describe ExtendedController do

it 'should include params from both original controller and extending concern' do
it 'includes params from both original controller and extending concern' do
expect(Apipie["extended#create"].params.keys).to eq [:oauth, :user, :admin]
user_param = Apipie["extended#create"].params[:user]
expect(user_param.validator.params_ordered.map(&:name)).to eq [:name, :password, :from_concern]
end

it 'should include updated metadata' do
it 'includes updated metadata' do
expect(Apipie['extended#create'].metadata).to eq metadata: 'data'
end
end
2 changes: 1 addition & 1 deletion spec/controllers/included_param_group_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

let(:dsl_data) { ActionController::Base.send(:_apipie_dsl_data_init) }

it "should not error when there is a param_group that is deeply nested in response description" do
it "does not error when there is a param_group that is deeply nested in response description" do
subject = Apipie.get_resource_description(IncludedParamGroupController, Apipie.configuration.default_version)
expect(subject._methods.keys).to include(:show)
end
Expand Down
Loading