tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

Add missing Minitests assertions #538

Closed workgena closed 5 years ago

workgena commented 5 years ago

As a references were used following resources:

New assertions:

assert_empty
assert_in_epsilon
assert_mock
assert_not_empty
assert_not_in_delta
assert_not_in_epsilon
assert_not_instance_of
assert_not_kind_of
assert_not_operator
assert_not_predicate
assert_not_respond_to
assert_not_send
assert_output
assert_predicate
assert_raises
assert_raise_with_message
assert_silent
workgena commented 5 years ago

The following assertions are missed as well:

assert_not_in_delta
assert_in_epsilon
assert_not_in_epsilon
assert_raises
assert_not_instance_of
assert_not_kind_of
assert_not_respond_to
assert_not_operator
assert_predicate
assert_not_predicate

Can add them too. What about adding them on a separate line?

syn keyword rubyAssertion assert_not_in_delta assert_in_epsilon assert_not_in_epsilon assert_raises assert_not_instance_of assert_not_kind_of assert_not_respond_to assert_not_operator assert_predicate assert_not_predicate
tpope commented 5 years ago

Not sure how I missed all these. I think we should have one line for the minitest built-ins, which should be more or less identical to the refute line, and one line for the Rails extensions.

tpope commented 5 years ago

Actually, we'd need an additional line for assert vs assert_not built-ins, I think.

workgena commented 5 years ago

Ok, I've removed previous commit. Added the following blocks:

line1: refute line2: assert line_3: assertnot*

line4: assert line_5: assertnot

line6: assert*

Last line is assertions without equivalents/opposites. As a references were used following resources:

tpope commented 5 years ago

Looks great, thanks.