Project

General

Profile

Bug #5114 ยป test-rake.diff

jeremyevans0 (Jeremy Evans), 07/30/2011 03:25 AM

View differences:

test/rake/helper.rb Wed Jul 27 15:48:16 2011
rakefile <<-VERBOSE
task :standalone_verbose_true do
verbose true
sh "ruby -e '0'"
sh "#{RUBY} -e '0'"
end
task :standalone_verbose_false do
verbose false
sh "ruby -e '0'"
sh "#{RUBY} -e '0'"
end
task :inline_verbose_default do
sh "ruby -e '0'"
sh "#{RUBY} -e '0'"
end
task :inline_verbose_false do
sh "ruby -e '0'", :verbose => false
sh "#{RUBY} -e '0'", :verbose => false
end
task :inline_verbose_true do
sh "ruby -e '0'", :verbose => true
sh "#{RUBY} -e '0'", :verbose => true
end
task :block_verbose_true do
verbose(true) do
sh "ruby -e '0'"
sh "#{RUBY} -e '0'"
end
end
task :block_verbose_false do
verbose(false) do
sh "ruby -e '0'"
sh "#{RUBY} -e '0'"
end
end
VERBOSE
-- test/rake/test_rake_functional.rb.orig Wed Jul 27 15:49:14 2011
++ test/rake/test_rake_functional.rb Wed Jul 27 15:49:18 2011
......
rake "inline_verbose_default"
assert_match(/ruby -e/, @err)
assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
end
def test_inline_verbose_true_should_show_command
......
rake "inline_verbose_true"
assert_match(/ruby -e/, @err)
assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
end
def test_inline_verbose_false_should_not_show_command
......
rake "inline_verbose_false"
refute_match(/ruby -e/, @err)
refute_match(/#{Regexp.quote(RUBY)} -e/, @err)
end
def test_block_verbose_false_should_not_show_command
......
rake "block_verbose_false"
refute_match(/ruby -e/, @err)
refute_match(/#{Regexp.quote(RUBY)} -e/, @err)
end
def test_block_verbose_true_should_show_command
......
rake "block_verbose_true"
assert_match(/ruby -e/, @err)
assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
end
def test_standalone_verbose_true_should_show_command
......
rake "standalone_verbose_true"
assert_match(/ruby -e/, @err)
assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
end
def test_standalone_verbose_false_should_not_show_command
......
rake "standalone_verbose_false"
refute_match(/ruby -e/, @err)
refute_match(/#{Regexp.quote(RUBY)} -e/, @err)
end
def test_dry_run
    (1-1/1)