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
ca6c55df
Commit
ca6c55df
authored
Jun 02, 2012
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #220 from bovi/test-for-issue210
Add Test Case for issue #210
parents
729c2e7b
cb10b927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
test/t/module.rb
test/t/module.rb
+47
-0
No files found.
test/t/module.rb
View file @
ca6c55df
...
...
@@ -5,6 +5,53 @@ assert('Module', '15.2.2') do
Module
.
class
==
Class
end
assert
(
'Module#const_defined?'
,
'15.2.2.4.20'
)
do
module
Test4ConstDefined
Const4Test4ConstDefined
=
true
end
Test4ConstDefined
.
const_defined?
(
:Const4Test4ConstDefined
)
and
not
Test4ConstDefined
.
const_defined?
(
:NotExisting
)
end
assert
(
'Module#const_get'
,
'15.2.2.4.21'
)
do
module
Test4ConstGet
Const4Test4ConstGet
=
42
end
Test4ConstGet
.
const_get
(
:Const4Test4ConstGet
)
==
42
end
assert
(
'Module.const_missing'
,
'15.2.2.4.22'
)
do
e1
=
nil
module
Test4ConstMissing
def
const_missing
(
sym
)
# ATM this redirect doesn't work
puts
"PLEASE GO TO TEST CASE Module.const_missing!"
puts
"IT IS WORKING NOW!! PLEASE FINALIZE."
puts
"Thanks :)"
end
end
begin
Test4ConstMissing
.
const_get
(
:ConstDoesntExist
)
rescue
=>
e2
e1
=
e2
end
e1
.
class
==
NameError
end
assert
(
'Module#const_get'
,
'15.2.2.4.23'
)
do
module
Test4ConstSet
Const4Test4ConstSet
=
42
end
Test4ConstSet
.
const_set
(
:Const4Test4ConstSet
,
23
)
Test4ConstSet
.
const_get
(
:Const4Test4ConstSet
)
==
23
end
# TODO not implemented ATM assert('Module.constants', '15.2.2') do
# TODO not implemented ATM assert('Module.nesting', '15.2.2') 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