summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r--test/psych/test_exception.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb
index 78601d09c79..4d76081e838 100644
--- a/test/psych/test_exception.rb
+++ b/test/psych/test_exception.rb
@@ -44,31 +44,31 @@ module Psych
end
def test_load_takes_file
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.load '--- `'
end
assert_nil ex.file
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.load '--- `', filename: 'meow'
end
assert_equal 'meow', ex.file
# deprecated interface
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.load '--- `', 'deprecated'
end
assert_equal 'deprecated', ex.file
end
def test_psych_parse_stream_takes_file
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.parse_stream '--- `'
end
assert_nil ex.file
assert_match '(<unknown>)', ex.message
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.parse_stream '--- `', filename: 'omg!'
end
assert_equal 'omg!', ex.file
@@ -76,19 +76,19 @@ module Psych
end
def test_load_stream_takes_file
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.load_stream '--- `'
end
assert_nil ex.file
assert_match '(<unknown>)', ex.message
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.load_stream '--- `', filename: 'omg!'
end
assert_equal 'omg!', ex.file
# deprecated interface
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.load_stream '--- `', 'deprecated'
end
assert_equal 'deprecated', ex.file
@@ -99,7 +99,7 @@ module Psych
t.binmode
t.write '--- `'
t.close
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.parse_file t.path
end
assert_equal t.path, ex.file
@@ -111,7 +111,7 @@ module Psych
t.binmode
t.write '--- `'
t.close
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.load_file t.path
end
assert_equal t.path, ex.file
@@ -123,7 +123,7 @@ module Psych
t.binmode
t.write '--- `'
t.close
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.safe_load_file t.path
end
assert_equal t.path, ex.file
@@ -131,26 +131,26 @@ module Psych
end
def test_psych_parse_takes_file
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.parse '--- `'
end
assert_match '(<unknown>)', ex.message
assert_nil ex.file
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.parse '--- `', filename: 'omg!'
end
assert_match 'omg!', ex.message
# deprecated interface
- ex = assert_raises(Psych::SyntaxError) do
+ ex = assert_raise(Psych::SyntaxError) do
Psych.parse '--- `', 'deprecated'
end
assert_match 'deprecated', ex.message
end
def test_attributes
- e = assert_raises(Psych::SyntaxError) {
+ e = assert_raise(Psych::SyntaxError) {
Psych.load '--- `foo'
}