Skip to content

Commit

Permalink
Fix strict_unused_block warnings when running specs on Ruby 3.4
Browse files Browse the repository at this point in the history
Run the specs with -W:strict_unused_block on Ruby 3.4 to more
easily catch future issues.
  • Loading branch information
jeremyevans committed Dec 18, 2024
1 parent 5bd816a commit 410ef7c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
=== master

* Fix strict_unused_block warnings when running specs on Ruby 3.4 (jeremyevans)

* Make rodauth.*_email_recently_sent? methods public (jeremyevans)

* Add Rodauth::ConfigurationError, and use it for configuration errors (janko) (#458)
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ task :default=>:spec

spec = proc do |env|
env.each{|k,v| ENV[k] = v}
sh "#{FileUtils::RUBY} #{"-w" if RUBY_VERSION >= '3'} spec/all.rb"
sh "#{FileUtils::RUBY} #{"-w" if RUBY_VERSION >= '3'} #{'-W:strict_unused_block' if RUBY_VERSION >= '3.4'} spec/all.rb"
env.each{|k,v| ENV.delete(k)}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/email_auth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def rodauth.raised_uniqueness_violation(*) super; true; end
enable :login, :email_auth
end
roda do |r|
def rodauth.raised_uniqueness_violation(*) StandardError.new; end
def rodauth.raised_uniqueness_violation(*, &_) StandardError.new; end
r.rodauth
r.root{view :content=>""}
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lockout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def rodauth.raised_uniqueness_violation(*) super; true; end
after_account_lockout{lockouts << true}
end
roda do |r|
def rodauth.raised_uniqueness_violation(*) ArgumentError.new; end
def rodauth.raised_uniqueness_violation(*, &_) ArgumentError.new; end
r.rodauth
r.root{view :content=>(rodauth.logged_in? ? "Logged In" : "Not Logged")}
end
Expand Down
2 changes: 1 addition & 1 deletion spec/remember_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def rodauth.raised_uniqueness_violation(*) super; true; end
enable :login, :remember
end
roda do |r|
def rodauth.raised_uniqueness_violation(*) StandardError.new; end
def rodauth.raised_uniqueness_violation(*, &_) StandardError.new; end
r.rodauth
r.root{''}
end
Expand Down
2 changes: 1 addition & 1 deletion spec/reset_password_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def rodauth.raised_uniqueness_violation(*) super; true; end
enable :login, :reset_password
end
roda do |r|
def rodauth.raised_uniqueness_violation(*) StandardError.new; end
def rodauth.raised_uniqueness_violation(*, &_) StandardError.new; end
r.rodauth
r.root{view :content=>""}
end
Expand Down
2 changes: 1 addition & 1 deletion spec/verify_account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def rodauth.raised_uniqueness_violation(*) super; true; end
enable :login, :verify_account
end
roda do |r|
def rodauth.raised_uniqueness_violation(*) StandardError.new; end
def rodauth.raised_uniqueness_violation(*, &_) StandardError.new; end
r.rodauth
r.root{view :content=>rodauth.logged_in? ? "Logged In" : "Not Logged"}
end
Expand Down

0 comments on commit 410ef7c

Please sign in to comment.