Skip to content

Commit

Permalink
Merge pull request #10 from ppostma/rubocop-rspec-update
Browse files Browse the repository at this point in the history
Update dev dependencies: RuboCop & RSpec
  • Loading branch information
ppostma authored Nov 10, 2024
2 parents 32f997c + 75ab2b3 commit f5d0950
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ AllCops:
- 'lib/smart_paginate/version.rb'
- 'vendor/**/*'

Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec

Layout/LineLength:
Enabled: false

Expand Down
53 changes: 27 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ GEM
drb (2.2.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.8.1)
language_server-protocol (3.17.0.3)
logger (1.6.1)
minitest (5.25.1)
parallel (1.26.3)
Expand All @@ -46,39 +48,38 @@ GEM
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rexml (3.3.9)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.3)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.4)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.7)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.2)
rubocop (1.12.1)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.34.1)
parser (>= 3.3.1.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.4.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
rubocop-rspec (3.2.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
securerandom (0.3.1)
sqlite3 (2.2.0-x86_64-darwin)
Expand All @@ -95,8 +96,8 @@ DEPENDENCIES
activerecord (~> 8.0.0)
bundler (>= 1.12)
rake (~> 13.0)
rspec (~> 3.12.0)
rubocop (~> 1.12.0)
rspec (~> 3.13.0)
rubocop (~> 1.68.0)
rubocop-performance
rubocop-rake
rubocop-rspec
Expand Down
2 changes: 1 addition & 1 deletion lib/smart_paginate/active_record_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def count(*args)
rel = except(:limit).limit(per_page)
rel.count(*args)
else
super(*args)
super
end
end

Expand Down
4 changes: 2 additions & 2 deletions smart_paginate.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'bundler', '>= 1.12'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.12.0'
spec.add_development_dependency 'rubocop', '~> 1.12.0'
spec.add_development_dependency 'rspec', '~> 3.13.0'
spec.add_development_dependency 'rubocop', '~> 1.68.0'
spec.add_development_dependency 'rubocop-performance'
spec.add_development_dependency 'rubocop-rake'
spec.add_development_dependency 'rubocop-rspec'
Expand Down
10 changes: 5 additions & 5 deletions spec/smart_paginate/active_record_extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
it 'returns nil after the last page' do
users = User.order(:name).paginate(per_page: 1, page: 11)
expect(users.length).to eq(0)
expect(users.first).to be nil
expect(users.first).to be_nil
end
end

Expand Down Expand Up @@ -182,12 +182,12 @@

it 'returns nil when no pages are present' do
users = User.paginate(per_page: 1, page: 1)
expect(users.previous_page).to be nil
expect(users.previous_page).to be_nil
end

it 'returns nil when there are no records' do
users = User.nothing.paginate(per_page: 1, page: 1)
expect(users.previous_page).to be nil
expect(users.previous_page).to be_nil
end
end

Expand All @@ -204,12 +204,12 @@

it 'returns nil when no pages are present' do
users = User.paginate(per_page: 1, page: 10)
expect(users.next_page).to be nil
expect(users.next_page).to be_nil
end

it 'returns nil when there are no records' do
users = User.nothing.paginate(per_page: 1, page: 1)
expect(users.next_page).to be nil
expect(users.next_page).to be_nil
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/smart_paginate/paginating_array_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
it 'returns nil after the last page' do
users = array.paginate(per_page: 1, page: 20)
expect(users.length).to eq(0)
expect(users.first).to be nil
expect(users.first).to be_nil
end

it 'does not modify the original array when paginating' do
Expand Down Expand Up @@ -131,7 +131,7 @@

it 'returns nil when no pages are present' do
users = array.paginate(per_page: 1, page: 1)
expect(users.previous_page).to be nil
expect(users.previous_page).to be_nil
end
end

Expand All @@ -148,7 +148,7 @@

it 'returns nil when no pages are present' do
users = array.paginate(per_page: 1, page: 10)
expect(users.next_page).to be nil
expect(users.next_page).to be_nil
end
end
end

0 comments on commit f5d0950

Please sign in to comment.