Skip to content

Commit 9b0454e

Browse files
committed
Linting and cleanup
1 parent 24afb4f commit 9b0454e

File tree

5 files changed

+15
-54
lines changed

5 files changed

+15
-54
lines changed

.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ Sequel/SaveChanges:
3232

3333
Lint/UselessMethodDefinition:
3434
Enabled: false
35+
36+
RSpec/FilePath:
37+
Include:
38+
- spec
39+
- spec_orms
40+
41+
RSpec/BeforeAfterAll:
42+
Enabled: false

.rubocop_todo.yml

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2021-03-24 02:03:11 UTC using RuboCop version 1.11.0.
3+
# on 2021-03-24 02:21:52 UTC using RuboCop version 1.11.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -13,14 +13,6 @@ Gemspec/RequiredRubyVersion:
1313
Exclude:
1414
- 'omniauth-identity.gemspec'
1515

16-
# Offense count: 2
17-
# Configuration parameters: AllowedMethods.
18-
# AllowedMethods: enums
19-
Lint/ConstantDefinitionInBlock:
20-
Exclude:
21-
- 'spec_orms/active_record_spec.rb'
22-
- 'spec_orms/sequel_spec.rb'
23-
2416
# Offense count: 1
2517
# Configuration parameters: AllowComments.
2618
Lint/EmptyClass:
@@ -32,13 +24,6 @@ Lint/MissingSuper:
3224
Exclude:
3325
- 'lib/omniauth/identity/secure_password.rb'
3426

35-
# Offense count: 1
36-
Lint/UselessAssignment:
37-
Exclude:
38-
- '**/*.md'
39-
- '**/*.markdown'
40-
- 'Rakefile'
41-
4227
# Offense count: 2
4328
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
4429
Metrics/AbcSize:
@@ -90,16 +75,6 @@ Naming/PredicateName:
9075
- 'spec/**/*'
9176
- 'lib/omniauth/identity/secure_password.rb'
9277

93-
# Offense count: 3
94-
RSpec/BeforeAfterAll:
95-
Exclude:
96-
- 'spec/spec_helper.rb'
97-
- 'spec/rails_helper.rb'
98-
- 'spec/support/**/*.rb'
99-
- 'spec_orms/couch_potato_spec.rb'
100-
- 'spec_orms/nobrainer_spec.rb'
101-
- 'spec_orms/sequel_spec.rb'
102-
10378
# Offense count: 6
10479
# Configuration parameters: Prefixes.
10580
# Prefixes: when, with, without
@@ -119,26 +94,6 @@ RSpec/ExpectInHook:
11994
Exclude:
12095
- 'spec/omniauth/strategies/identity_spec.rb'
12196

122-
# Offense count: 8
123-
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
124-
# Include: **/*_spec*rb*, **/spec/**/*
125-
RSpec/FilePath:
126-
Exclude:
127-
- 'spec/omniauth/identity/model_spec.rb'
128-
- 'spec/omniauth/identity/secure_password_spec.rb'
129-
- 'spec/omniauth/strategies/identity_spec.rb'
130-
- 'spec_orms/active_record_spec.rb'
131-
- 'spec_orms/couch_potato_spec.rb'
132-
- 'spec_orms/mongoid_spec.rb'
133-
- 'spec_orms/nobrainer_spec.rb'
134-
- 'spec_orms/sequel_spec.rb'
135-
136-
# Offense count: 2
137-
RSpec/LeakyConstantDeclaration:
138-
Exclude:
139-
- 'spec_orms/active_record_spec.rb'
140-
- 'spec_orms/sequel_spec.rb'
141-
14297
# Offense count: 8
14398
# Configuration parameters: .
14499
# SupportedStyles: have_received, receive
@@ -172,11 +127,11 @@ RSpec/StubbedMock:
172127
# Offense count: 5
173128
RSpec/SubjectStub:
174129
Exclude:
175-
- 'spec_orms/active_record_spec.rb'
130+
- 'spec/omniauth/identity/models/active_record_spec.rb'
131+
- 'spec/omniauth/identity/models/sequel_spec.rb'
176132
- 'spec_orms/couch_potato_spec.rb'
177133
- 'spec_orms/mongoid_spec.rb'
178134
- 'spec_orms/nobrainer_spec.rb'
179-
- 'spec_orms/sequel_spec.rb'
180135

181136
# Offense count: 4
182137
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.

Rakefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ rescue LoadError
2323
task :test do
2424
warn 'RSpec is disabled'
2525
end
26-
task :spec do
27-
warn 'RSpec is disabled'
28-
end
2926
end
3027

3128
begin
@@ -39,4 +36,3 @@ end
3936

4037
# These tests do not require any services to be running, so this is what we run via Github Actions
4138
task default: %i[test]
42-

spec/omniauth/identity/models/active_record_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
require 'active_record'
55
require 'anonymous_active_record'
66

7+
class TestIdentity < OmniAuth::Identity::Models::ActiveRecord; end
8+
79
RSpec.describe(OmniAuth::Identity::Models::ActiveRecord, sqlite3: true) do
810
describe 'model', type: :model do
911
subject(:model_klass) do
@@ -21,7 +23,6 @@ def flower
2123
include_context 'persistable model'
2224

2325
describe '::table_name' do
24-
class TestIdentity < OmniAuth::Identity::Models::ActiveRecord; end
2526
it 'does not use STI rules for its table name' do
2627
expect(TestIdentity.table_name).to eq('test_identities')
2728
end

spec/omniauth/identity/models/sequel_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
require 'sqlite3'
44
require 'sequel'
55

6+
DB = Sequel.sqlite
7+
68
RSpec.describe(OmniAuth::Identity::Models::Sequel, sqlite3: true) do
79
before(:all) do
810
# Connect to an in-memory sqlite3 database.
9-
DB = Sequel.sqlite
1011
DB.create_table :sequel_test_identities do
1112
primary_key :id
1213
String :email, null: false

0 commit comments

Comments
 (0)