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
57bd8d49
Commit
57bd8d49
authored
Jun 03, 2012
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add first test case for Class#new and prepare further feature tests for it
parent
5fcd5205
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
test/t/class.rb
test/t/class.rb
+30
-0
No files found.
test/t/class.rb
View file @
57bd8d49
...
...
@@ -5,6 +5,36 @@ assert('Class', '15.2.3') do
Class
.
class
==
Class
end
assert
(
'Class#new'
,
'15.2.3.3.3'
)
do
# at the moment no exception on singleton class
#e1 = nil
#begin
# class1 = e1.singleton_class.new
#rescue => e1
# e2 = e1
#end
class
TestClass
def
initialize
args
,
&
block
@result
=
if
not
args
.
nil?
and
block
.
nil?
# only arguments
:only_args
elsif
not
args
.
nil?
and
not
block
.
nil?
# args and block is given
:args_and_block
else
# this should never happen
:broken
end
end
def
result
;
@result
;
end
end
TestClass
.
new
(
:arg
).
result
==
:only_args
# with block doesn't work yet
end
# Not ISO specified
assert
(
'Class 1'
)
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