summaryrefslogtreecommitdiff
path: root/test/optparse
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 17:44:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 17:44:39 +0000
commit00b4a3f9c4aaf5aa038a9530ec515e1718ae1c42 (patch)
treeb57bc2afea00aa87978f691526dd7adc1b8a067d /test/optparse
parent48fdf59dcfbb6964d992b6f31d0eb6f023776145 (diff)
* test: assert_raises has been deprecated since a long time ago.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/optparse')
-rw-r--r--test/optparse/test_noarg.rb12
-rw-r--r--test/optparse/test_reqarg.rb6
2 files changed, 9 insertions, 9 deletions
diff --git a/test/optparse/test_noarg.rb b/test/optparse/test_noarg.rb
index 28c4690..329956a 100644
--- a/test/optparse/test_noarg.rb
+++ b/test/optparse/test_noarg.rb
@@ -18,7 +18,7 @@ module TestOptionParser::NoArg
end
def test_short
- assert_raises(OptionParser::InvalidOption) {@opt.parse!(%w"-xq")}
+ assert_raise(OptionParser::InvalidOption) {@opt.parse!(%w"-xq")}
assert_equal(%w"", no_error {@opt.parse!(%w"-x")})
assert_equal(true, @flag)
@flag = nil
@@ -27,11 +27,11 @@ module TestOptionParser::NoArg
end
def test_abbrev
- assert_raises(OptionParser::InvalidOption) {@opt.parse!(%w"-oq")}
+ assert_raise(OptionParser::InvalidOption) {@opt.parse!(%w"-oq")}
assert_equal(%w"", no_error {@opt.parse!(%w"-o")})
assert_equal(true, @flag)
@flag = nil
- assert_raises(OptionParser::InvalidOption) {@opt.parse!(%w"-O")}
+ assert_raise(OptionParser::InvalidOption) {@opt.parse!(%w"-O")}
assert_nil(@flag)
@flag = nil
assert_equal(%w"foo", no_error {@opt.parse!(%w"-o foo")})
@@ -39,7 +39,7 @@ module TestOptionParser::NoArg
end
def test_long
- assert_raises(OptionParser::NeedlessArgument) {@opt.parse!(%w"--option=x")}
+ assert_raise(OptionParser::NeedlessArgument) {@opt.parse!(%w"--option=x")}
assert_equal(%w"", no_error {@opt.parse!(%w"--opt")})
assert_equal(true, @flag)
@flag = nil
@@ -49,8 +49,8 @@ module TestOptionParser::NoArg
def test_ambiguous
@opt.def_option("--open") {|x|}
- assert_raises(OptionParser::AmbiguousOption) {@opt.parse!(%w"--op")}
- assert_raises(OptionParser::AmbiguousOption) {@opt.parse!(%w"-o")}
+ assert_raise(OptionParser::AmbiguousOption) {@opt.parse!(%w"--op")}
+ assert_raise(OptionParser::AmbiguousOption) {@opt.parse!(%w"-o")}
assert_equal(%w"", no_error {@opt.parse!(%w"--opt")})
assert_equal(true, @flag)
end
diff --git a/test/optparse/test_reqarg.rb b/test/optparse/test_reqarg.rb
index 0999e5e..4ce9dd6 100644
--- a/test/optparse/test_reqarg.rb
+++ b/test/optparse/test_reqarg.rb
@@ -32,7 +32,7 @@ module TestOptionParser::ReqArg
end
def test_short
- assert_raises(OptionParser::MissingArgument) {@opt.parse!(%w"-x")}
+ assert_raise(OptionParser::MissingArgument) {@opt.parse!(%w"-x")}
assert_equal(%w"", no_error {@opt.parse!(%w"-x foo")})
assert_equal("foo", @flag)
assert_equal(%w"", no_error {@opt.parse!(%w"-xbar")})
@@ -42,7 +42,7 @@ module TestOptionParser::ReqArg
end
def test_abbrev
- assert_raises(OptionParser::MissingArgument) {@opt.parse!(%w"-o")}
+ assert_raise(OptionParser::MissingArgument) {@opt.parse!(%w"-o")}
assert_equal(%w"", no_error {@opt.parse!(%w"-o foo")})
assert_equal("foo", @flag)
assert_equal(%w"", no_error {@opt.parse!(%w"-obar")})
@@ -52,7 +52,7 @@ module TestOptionParser::ReqArg
end
def test_long
- assert_raises(OptionParser::MissingArgument) {@opt.parse!(%w"--opt")}
+ assert_raise(OptionParser::MissingArgument) {@opt.parse!(%w"--opt")}
assert_equal(%w"", no_error {@opt.parse!(%w"--opt foo")})
assert_equal("foo", @flag)
assert_equal(%w"foo", no_error {@opt.parse!(%w"--opt= foo")})