use `unless` instead of `if not`.

parent d0a7e01d
......@@ -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
}
......
......@@ -133,7 +133,7 @@ class String
if args.length == 2 && block
block = nil
end
if !block
unless block
replace = replace.to_str
end
result = []
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment