Project

General

Profile

Feature #3631 ยป 0001-lib-rake.rb-allow-passing-nil-to-sh-and-ruby.patch

sunaku (Suraj Kurapati), 07/30/2010 02:02 PM

View differences:

lib/rake.rb
#
def sh(*cmd, &block)
options = (Hash === cmd.last) ? cmd.pop : {}
cmd.compact!
unless block_given?
show_command = cmd.join(" ")
show_command = show_command[0,42] + "..." unless $trace
test/rake/test_fileutils.rb
}
end
def test_sh_with_nil_arguments
verbose(false) {
Sh.run RUBY, nil, nil, nil, '-e', nil, 'true', nil, nil, nil, nil, nil
}
end
def test_sh_failure
assert_raise(RuntimeError) {
verbose(false) { Sh.run "#{RUBY} #{File.expand_path('../shellcommand.rb', __FILE__)} 1" }
......
}
end
def test_ruby_with_nil_arguments
verbose(false) {
ruby nil, nil, nil, '-e', nil, 'true', nil, nil, nil, nil, nil
}
end
def test_split_all
assert_equal ['a'], RakeFileUtils.split_all('a')
assert_equal ['..'], RakeFileUtils.split_all('..')
    (1-1/1)