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
8a7298e0
Commit
8a7298e0
authored
Feb 19, 2019
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more appropriate assertion methods
parent
971bfd13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
37 deletions
+39
-37
mrbgems/mruby-metaprog/test/metaprog.rb
mrbgems/mruby-metaprog/test/metaprog.rb
+6
-5
test/t/bs_block.rb
test/t/bs_block.rb
+32
-31
test/t/module.rb
test/t/module.rb
+1
-1
No files found.
mrbgems/mruby-metaprog/test/metaprog.rb
View file @
8a7298e0
...
...
@@ -143,8 +143,8 @@ assert('Module#class_variable_set', '15.2.2.4.18') do
end
end
assert_
true
Test4ClassVariableSet
.
class_variable_set
(
:@@cv
,
99
)
assert_
true
Test4ClassVariableSet
.
class_variable_set
(
:@@foo
,
101
)
assert_
equal
99
,
Test4ClassVariableSet
.
class_variable_set
(
:@@cv
,
99
)
assert_
equal
101
,
Test4ClassVariableSet
.
class_variable_set
(
:@@foo
,
101
)
assert_true
Test4ClassVariableSet
.
class_variables
.
include?
:@@cv
assert_equal
99
,
Test4ClassVariableSet
.
class_variable_get
(
:@@cv
)
assert_equal
101
,
Test4ClassVariableSet
.
new
.
foo
...
...
@@ -238,9 +238,10 @@ assert('Module#remove_method', '15.2.2.4.41') do
end
end
assert_true
Test4RemoveMethod
::
Child
.
class_eval
{
remove_method
:hello
}
assert_true
Test4RemoveMethod
::
Child
.
instance_methods
.
include?
:hello
assert_false
Test4RemoveMethod
::
Child
.
instance_methods
(
false
).
include?
:hello
klass
=
Test4RemoveMethod
::
Child
assert_same
klass
,
klass
.
class_eval
{
remove_method
:hello
}
assert_true
klass
.
instance_methods
.
include?
:hello
assert_false
klass
.
instance_methods
(
false
).
include?
:hello
end
assert
(
'Module.nesting'
,
'15.2.2.2.2'
)
do
...
...
test/t/bs_block.rb
View file @
8a7298e0
...
...
@@ -408,42 +408,43 @@ assert('BS Block 32') do
end
assert
(
'BS Block [ruby-core:14395]'
)
do
class
Controller
def
respond_to
(
&
block
)
responder
=
Responder
.
new
block
.
call
(
responder
)
responder
.
respond
end
def
test_for_bug
respond_to
{
|
format
|
format
.
js
{
"in test"
render
{
|
obj
|
obj
assert_nothing_raised
do
class
Controller
def
respond_to
(
&
block
)
responder
=
Responder
.
new
block
.
call
(
responder
)
responder
.
respond
end
def
test_for_bug
respond_to
{
|
format
|
format
.
js
{
"in test"
render
{
|
obj
|
obj
}
}
}
}
end
def
render
(
&
block
)
"in render"
end
end
class
Responder
def
method_missing
(
symbol
,
&
block
)
"enter method_missing"
@response
=
Proc
.
new
{
'in method missing'
block
.
call
}
"leave method_missing"
end
def
render
(
&
block
)
"in render"
end
end
def
respond
@response
.
call
class
Responder
def
method_missing
(
symbol
,
&
block
)
"enter method_missing"
@response
=
Proc
.
new
{
'in method missing'
block
.
call
}
"leave method_missing"
end
def
respond
@response
.
call
end
end
t
=
Controller
.
new
t
.
test_for_bug
end
t
=
Controller
.
new
assert_true
t
.
test_for_bug
end
assert
(
"BS Block 33"
)
do
...
...
test/t/module.rb
View file @
8a7298e0
...
...
@@ -231,7 +231,7 @@ assert('Module#const_set', '15.2.2.4.23') do
Const4Test4ConstSet
=
42
end
assert_
true
Test4ConstSet
.
const_set
(
:Const4Test4ConstSet
,
23
)
assert_
equal
23
,
Test4ConstSet
.
const_set
(
:Const4Test4ConstSet
,
23
)
assert_equal
23
,
Test4ConstSet
.
const_get
(
:Const4Test4ConstSet
)
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