Unnest assertion helper as suggested by RuboCop
@@ -183,7 +183,6 @@ def string_tr
raise unless 'abcd'.tr('a-z', 'xxx') == 'xxxx'
end
-def string_end_with
def assert_raise_type_error
yield
rescue TypeError
@@ -192,6 +191,7 @@ def string_end_with
raise
end
+def string_end_with
assert_raise_type_error { 'abc'.end_with?(/c/) }
assert_raise_type_error { 'abc'.end_with?('e', 'xyz', /c/) }
