1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_assignment.rb: use bug number for assert message

to suppress variable unused warning
This commit is contained in:
Yusuke Endoh 2019-09-21 19:23:47 +09:00
parent b414999370
commit 5cb283217b

View file

@ -119,31 +119,31 @@ class TestAssignment < Test::Unit::TestCase
def []=(i, a); 42; end
end
assert_raise(NoMethodError) {
assert_raise(NoMethodError, bug11096) {
o.instance_eval {o.foo = 1}
}
assert_nothing_raised(NoMethodError) {
assert_nothing_raised(NoMethodError, bug11096) {
assert_equal(1, o.instance_eval {self.foo = 1})
}
assert_raise(NoMethodError) {
assert_raise(NoMethodError, bug11096) {
o.instance_eval {o[0] = 1}
}
assert_nothing_raised(NoMethodError) {
assert_nothing_raised(NoMethodError, bug11096) {
assert_equal(1, o.instance_eval {self[0] = 1})
}
assert_nothing_raised(NoMethodError) {
assert_nothing_raised(NoMethodError, bug11096) {
o.instance_eval {self.foo += 1}
}
assert_nothing_raised(NoMethodError) {
assert_nothing_raised(NoMethodError, bug11096) {
o.instance_eval {self.foo &&= 1}
}
assert_nothing_raised(NoMethodError) {
assert_nothing_raised(NoMethodError, bug11096) {
o.instance_eval {self[0] += 1}
}
assert_nothing_raised(NoMethodError) {
assert_nothing_raised(NoMethodError, bug11096) {
o.instance_eval {self[0] &&= 1}
}
end