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
6696876e
Commit
6696876e
authored
Jul 17, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring on module tests
parent
526dd09b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
test/t/module.rb
test/t/module.rb
+4
-14
No files found.
test/t/module.rb
View file @
6696876e
...
...
@@ -14,7 +14,6 @@ end
# TODO not implemented ATM assert('Module.nesting', '15.2.2.3.2') do
assert
(
'Module#ancestors'
,
'15.2.2.4.9'
)
do
r
=
String
.
ancestors
r
.
class
==
Array
and
r
.
include?
(
String
)
and
r
.
include?
(
Object
)
end
...
...
@@ -53,21 +52,12 @@ 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 :)"
def
self
.
const_missing
(
sym
)
42
# the answer to everything
end
end
begin
Test4ConstMissing
.
const_get
(
:ConstDoesntExist
)
rescue
=>
e2
e1
=
e2
end
e1
.
class
==
NameError
Test4ConstMissing
.
const_get
(
:ConstDoesntExist
)
==
42
end
assert
(
'Module#const_get'
,
'15.2.2.4.23'
)
do
...
...
@@ -93,7 +83,7 @@ end
assert
(
'Module#included'
,
'15.2.2.4.29'
)
do
module
Test4Included
Const4Included
=
42
def
Test4Included
.
included
mod
def
self
.
included
mod
Test4Included
.
const_set
(
:Const4Included2
,
mod
)
end
end
...
...
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