Skip to content

Commit

Permalink
Fix standardrb issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmarshall committed Sep 24, 2024
1 parent 59d67e1 commit 439eba3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/minitest/verify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class << self

def verify_fails_without(&block)
if @current_caller
block.call unless caller[0] == @current_caller[0]
block.call unless caller(1..1).first == @current_caller[0]
else
callers << caller
block.call
Expand All @@ -25,7 +25,7 @@ def run
return Result.from(self) unless Verify.enabled && failures.none?

begin
while @current_caller = callers.shift
while (@current_caller = callers.shift)
with_verification { super }
end
rescue VerificationFailedError
Expand Down
24 changes: 12 additions & 12 deletions test/minitest/verify_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Minitest
class VerifyTest < Minitest::Test
def test_passing_test
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
a = 1
verify_fails_without { a += 1 }
assert_equal 2, a
Expand All @@ -20,7 +20,7 @@ def test_foo

def test_failing_test
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
a = 1
verify_fails_without { a *= 1 }
assert_equal 2, a
Expand All @@ -36,7 +36,7 @@ def test_foo

def test_verifying_unnecessary_setup
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
a = 1
verify_fails_without { nil }
assert_equal 1, a
Expand All @@ -52,7 +52,7 @@ def test_foo

def test_verifying_necessary_setup
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
a = 1
verify_fails_without { a += 1 }
assert_equal 2, a
Expand All @@ -67,7 +67,7 @@ def test_foo

def test_verifying_failing_test
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
a = 1
verify_fails_without { nil }
assert_equal 2, a
Expand All @@ -83,7 +83,7 @@ def test_foo

def test_multiple_assertions
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
a = 1
verify_fails_without { a += 1 }
verify_fails_without { nil }
Expand All @@ -101,7 +101,7 @@ def test_foo

def test_unexpected_error
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
a = verify_fails_without { 1 }
a *= 3
assert_equal 3, a
Expand All @@ -117,12 +117,12 @@ def test_foo

def test_setup_method
test_class = build_test_class do
def setup
define_method(:setup) do
@a = 1
verify_fails_without { @a += 1 }
end

def test_foo
define_method(:test_foo) do
assert_equal 2, @a
end
end
Expand All @@ -135,7 +135,7 @@ def test_foo

def test_failing_test_without_verification
test_class = build_test_class do
def test_foo
define_method(:test_foo) do
assert_equal "abc", "def"
end
end
Expand All @@ -156,10 +156,10 @@ def enabled
Minitest::Verify.enabled = false
end

def build_test_class(&block)
def build_test_class(&)
test_class = Class.new(Minitest::Test)
test_class.include(Minitest::Verify)
test_class.class_eval(&block)
test_class.class_eval(&)
test_class
end
end
Expand Down

0 comments on commit 439eba3

Please sign in to comment.