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 df48d62
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 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,17 @@ 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
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 df48d62

Please sign in to comment.