mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
* struct.c (rb_struct_set): return assigned value from setter method
rather than struct object. [Bug #9353] [ruby-core:59509] * test/ruby/test_struct.rb (test_setter_method_returns_value): add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
54f6b3fe82
commit
306c154c2d
3 changed files with 15 additions and 1 deletions
|
@ -298,6 +298,12 @@ module TestStruct
|
|||
assert_same(x, o.b!)
|
||||
end
|
||||
|
||||
def test_setter_method_returns_value
|
||||
klass = @Struct.new(:a)
|
||||
x = klass.new
|
||||
assert_equal "[Bug #9353]", x.send(:a=, "[Bug #9353]")
|
||||
end
|
||||
|
||||
class TopStruct < Test::Unit::TestCase
|
||||
include TestStruct
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue