test/test_rules.rb in jimweirich-rake-0.8.3.1 vs test/test_rules.rb in jimweirich-rake-0.8.3.99

- old
+ new

@@ -2,15 +2,17 @@ require 'test/unit' require 'fileutils' require 'rake' require 'test/filecreation' +require 'test/rake_test_setup' ###################################################################### class TestRules < Test::Unit::TestCase include Rake include FileCreation + include TestMethods SRCFILE = "testdata/abc.c" SRCFILE2 = "testdata/xyz.c" FTNFILE = "testdata/abc.f" OBJFILE = "testdata/abc.o" @@ -188,12 +190,12 @@ def test_close_matches_on_name_do_not_trigger_rule create_file("testdata/x.c") rule '.o' => ['.c'] do |t| @runs << t.name end - assert_raises(RuntimeError) { Task['testdata/x.obj'].invoke } - assert_raises(RuntimeError) { Task['testdata/x.xyo'].invoke } + assert_exception(RuntimeError) { Task['testdata/x.obj'].invoke } + assert_exception(RuntimeError) { Task['testdata/x.xyo'].invoke } end def test_rule_rebuilds_obj_when_source_is_newer create_timed_files(OBJFILE, SRCFILE) rule(/\.o$/ => ['.c']) do @@ -330,18 +332,18 @@ prev = 'a' ('b'..'z').each do |letter| rule ".#{letter}" => ".#{prev}" do |t| puts "#{t.name}" end prev = letter end - ex = assert_raises(Rake::RuleRecursionOverflowError) { + ex = assert_exception(Rake::RuleRecursionOverflowError) { Task["testdata/a.z"].invoke } assert_match(/a\.z => testdata\/a.y/, ex.message) end def test_rules_with_bad_dependents_will_fail rule "a" => [ 1 ] do |t| puts t.name end - assert_raise(RuntimeError) do Task['a'].invoke end + assert_exception(RuntimeError) do Task['a'].invoke end end end