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
d16659c7
Commit
d16659c7
authored
Jan 20, 2013
by
Masamitsu MURASE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for `undef` and `alias`.
parent
7195fb87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
test/t/class.rb
test/t/class.rb
+75
-0
No files found.
test/t/class.rb
View file @
d16659c7
...
@@ -209,3 +209,78 @@ end
...
@@ -209,3 +209,78 @@ end
assert
(
'Class Dup 2'
)
do
assert
(
'Class Dup 2'
)
do
module
M
;
end
;
M
.
dup
.
class
==
Module
module
M
;
end
;
M
.
dup
.
class
==
Module
end
end
assert
(
'Class Alias 1'
)
do
class
A
def
test
;
1
;
end
alias
test2
test
alias
:test3
:test
end
A
.
new
.
test2
==
1
and
A
.
new
.
test3
==
1
end
assert
(
'Class Alias 2'
)
do
class
A
def
test
;
1
;
end
alias
test2
test
def
test
;
2
;
end
end
A
.
new
.
test
==
2
and
A
.
new
.
test2
==
1
end
assert
(
'Class Undef 1'
)
do
class
A
def
test1
;
1
;
end
def
test2
;
2
;
end
undef
test1
undef
:test2
end
result1
=
false
begin
A
.
new
.
test1
rescue
NoMethodError
result1
=
true
end
result2
=
false
begin
A
.
new
.
test2
rescue
NoMethodError
result2
=
true
end
result1
==
true
and
result2
==
true
end
assert
(
'Class Undef 2'
)
do
class
A
def
test1
;
1
;
end
def
test2
;
2
;
end
undef
test1
,
test2
end
result1
=
false
begin
A
.
new
.
test1
rescue
NoMethodError
result1
=
true
end
result2
=
false
begin
A
.
new
.
test2
rescue
NoMethodError
result2
=
true
end
result1
==
true
and
result2
==
true
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