Skip to content

Commit

Permalink
fixup! [Fix #117] Add new Minitest/AssertWithTwoArguments cop
Browse files Browse the repository at this point in the history
  • Loading branch information
cstyles committed Feb 21, 2021
1 parent c11c324 commit d8e98bf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/rubocop/cop/minitest/assert_with_two_arguments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ def test_do_something
RUBY
end

def test_registers_offense_when_second_argument_is_a_variable
assert_offense(<<~RUBY)
class FooTest < Minitest::Test
def test_do_something
my_list_length = 3
assert(3, my_list_length)
^^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean to use `assert_equal(3, my_list_length)`?
end
end
RUBY
end

def test_does_not_register_offense_when_assert_is_called_with_one_argument
assert_no_offenses(<<~RUBY)
class FooTest < Minitest::Test
Expand Down

0 comments on commit d8e98bf

Please sign in to comment.