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
bf322657
Commit
bf322657
authored
Aug 30, 2017
by
Christopher Aue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowed to pass multiple exceptions to assert_raise
parent
fe3227cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
test/assert.rb
test/assert.rb
+4
-2
No files found.
test/assert.rb
View file @
bf322657
...
...
@@ -143,17 +143,19 @@ def assert_not_include(collection, obj, msg = nil)
assert_false
(
collection
.
include?
(
obj
),
msg
,
diff
)
end
def
assert_raise
(
exc
,
msg
=
nil
)
def
assert_raise
(
*
exc
)
return
true
unless
$mrbtest_assert
$mrbtest_assert_idx
+=
1
msg
=
(
exc
.
last
.
is_a?
String
)
?
exc
.
pop
:
nil
begin
yield
msg
||=
"Expected to raise
#{
exc
}
but nothing was raised."
diff
=
nil
$mrbtest_assert
.
push
[
$mrbtest_assert_idx
,
msg
,
diff
]
false
rescue
exc
rescue
*
exc
true
rescue
Exception
=>
e
msg
||=
"Expected to raise
#{
exc
}
, not"
...
...
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