use unless instead of if not.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-06-21 11:13:33 +09:00
parent d0a7e01d9c
commit 057be5ffb5
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ class Enumerator
def reject(&block)
Lazy.new(self){|yielder, val|
if not block.call(val)
unless block.call(val)
yielder << val
end
}
+1 -1
View File
@@ -133,7 +133,7 @@ class String
if args.length == 2 && block
block = nil
end
if !block
unless block
replace = replace.to_str
end
result = []
+1 -1
View File
@@ -157,7 +157,7 @@ def assert_raise(*exp)
msg = "#{msg}#{exp.inspect} exception expected, not"
diff = " Class: <#{e.class}>\n" +
" Message: #{e.message}"
if not exp.any?{|ex| ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class }
unless exp.any?{|ex| ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class }
$mrbtest_assert.push([$mrbtest_assert_idx, msg, diff])
ret = false
end