Commit 9dc875f2 authored by Tomoyuki Sahara's avatar Tomoyuki Sahara

add `cmd` (command output expression).

parent 5e8021be
module Kernel
def self.`(cmd)
IO.popen(cmd) { |io| io.read }
end
def open(file, *rest, &block)
raise ArgumentError unless file.is_a?(String)
......
......@@ -232,6 +232,10 @@ assert('IO#fileno') do
io.closed?
end
assert('`cmd`') do
assert_equal `echo foo`, "foo\n"
end
assert('IO TEST CLEANUP') do
assert_nil MRubyIOTestUtil.io_test_cleanup
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