Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
ff90bb1c
Commit
ff90bb1c
authored
May 05, 2014
by
yui-knk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring exception test.
Change to use assert_equal explicitly.
parent
f0be02fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
test/t/exception.rb
test/t/exception.rb
+25
-17
No files found.
test/t/exception.rb
View file @
ff90bb1c
...
@@ -57,15 +57,16 @@ end
...
@@ -57,15 +57,16 @@ end
# Not ISO specified
# Not ISO specified
assert
(
'Exception 1'
)
do
assert
(
'Exception 1'
)
do
begin
r
=
begin
1
+
1
1
+
1
ensure
ensure
2
+
2
2
+
2
end
==
2
end
assert_equal
2
,
r
end
end
assert
(
'Exception 2'
)
do
assert
(
'Exception 2'
)
do
begin
r
=
begin
1
+
1
1
+
1
begin
begin
2
+
2
2
+
2
...
@@ -74,11 +75,12 @@ assert('Exception 2') do
...
@@ -74,11 +75,12 @@ assert('Exception 2') do
end
end
ensure
ensure
4
+
4
4
+
4
end
==
4
end
assert_equal
4
,
r
end
end
assert
(
'Exception 3'
)
do
assert
(
'Exception 3'
)
do
begin
r
=
begin
1
+
1
1
+
1
begin
begin
2
+
2
2
+
2
...
@@ -92,7 +94,8 @@ assert('Exception 3') do
...
@@ -92,7 +94,8 @@ assert('Exception 3') do
ensure
ensure
6
+
6
6
+
6
end
end
end
==
4
end
assert_equal
4
,
r
end
end
assert
(
'Exception 4'
)
do
assert
(
'Exception 4'
)
do
...
@@ -171,17 +174,18 @@ assert('Exception 7') do
...
@@ -171,17 +174,18 @@ assert('Exception 7') do
end
end
assert
(
'Exception 8'
)
do
assert
(
'Exception 8'
)
do
begin
r
=
begin
1
1
rescue
rescue
2
2
else
else
3
3
end
==
3
end
assert_equal
3
,
r
end
end
assert
(
'Exception 9'
)
do
assert
(
'Exception 9'
)
do
begin
r
=
begin
1
+
1
1
+
1
rescue
rescue
2
+
2
2
+
2
...
@@ -189,11 +193,12 @@ assert('Exception 9') do
...
@@ -189,11 +193,12 @@ assert('Exception 9') do
3
+
3
3
+
3
ensure
ensure
4
+
4
4
+
4
end
==
6
end
assert_equal
6
,
r
end
end
assert
(
'Exception 10'
)
do
assert
(
'Exception 10'
)
do
begin
r
=
begin
1
+
1
1
+
1
begin
begin
2
+
2
2
+
2
...
@@ -208,7 +213,8 @@ assert('Exception 10') do
...
@@ -208,7 +213,8 @@ assert('Exception 10') do
6
+
6
6
+
6
ensure
ensure
7
+
7
7
+
7
end
==
12
end
assert_equal
12
,
r
end
end
assert
(
'Exception 11'
)
do
assert
(
'Exception 11'
)
do
...
@@ -273,12 +279,12 @@ assert('Exception 16') do
...
@@ -273,12 +279,12 @@ assert('Exception 16') do
raise
"foo"
raise
"foo"
false
false
rescue
=>
e
rescue
=>
e
e
.
message
==
"foo"
assert_equal
"foo"
,
e
.
message
end
end
end
end
assert
(
'Exception 17'
)
do
assert
(
'Exception 17'
)
do
begin
r
=
begin
raise
"a"
# StandardError
raise
"a"
# StandardError
rescue
ArgumentError
rescue
ArgumentError
1
1
...
@@ -288,11 +294,12 @@ assert('Exception 17') do
...
@@ -288,11 +294,12 @@ assert('Exception 17') do
3
3
ensure
ensure
4
4
end
==
2
end
assert_equal
2
,
r
end
end
assert
(
'Exception 18'
)
do
assert
(
'Exception 18'
)
do
begin
r
=
begin
0
0
rescue
ArgumentError
rescue
ArgumentError
1
1
...
@@ -302,7 +309,8 @@ assert('Exception 18') do
...
@@ -302,7 +309,8 @@ assert('Exception 18') do
3
3
ensure
ensure
4
4
end
==
3
end
assert_equal
3
,
r
end
end
assert
(
'Exception 19'
)
do
assert
(
'Exception 19'
)
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment