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
b499ad67
Commit
b499ad67
authored
Jul 28, 2017
by
Christopher Aue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed return value of Module#include and #prepend
parent
46960936
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
mrblib/00class.rb
mrblib/00class.rb
+2
-0
test/t/module.rb
test/t/module.rb
+17
-1
No files found.
mrblib/00class.rb
View file @
b499ad67
...
...
@@ -15,6 +15,7 @@ class Module
m
.
append_features
(
self
)
m
.
included
(
self
)
end
self
end
def
prepend
(
*
args
)
...
...
@@ -22,5 +23,6 @@ class Module
m
.
prepend_features
(
self
)
m
.
prepended
(
self
)
end
self
end
end
test/t/module.rb
View file @
b499ad67
...
...
@@ -309,10 +309,14 @@ assert('Module#include', '15.2.2.4.27') do
Const4Include
=
42
end
module
Test4Include2
include
Test4Include
@include_result
=
include
Test4Include
class
<<
self
attr_reader
:include_result
end
end
assert_equal
42
,
Test4Include2
.
const_get
(
:Const4Include
)
assert_equal
Test4Include2
,
Test4Include2
.
include_result
end
assert
(
'Module#include?'
,
'15.2.2.4.28'
)
do
...
...
@@ -540,6 +544,18 @@ end
assert_equal
(
expected
,
obj
.
m1
)
end
assert
(
'Module#prepend result'
)
do
module
TestPrepended
;
end
module
TestPrependResult
@prepend_result
=
prepend
TestPrepended
class
<<
self
attr_reader
:prepend_result
end
end
assert_equal
TestPrependResult
,
TestPrependResult
.
prepend_result
end
# mruby shouldn't be affected by this since there is
# no visibility control (yet)
assert
(
'Module#prepend public'
)
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