aboutsummaryrefslogtreecommitdiffstats
path: root/test/ostruct
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/ostruct] Add Ractor testMarc-Andre Lafortune2020-12-191-12/+11
|
* [lib/ostruct] Fix Marshal loadingMarc-Andre Lafortune2020-10-061-0/+6
|
* stop Ractor test in test-allKoichi Sasada2020-10-011-0/+3
| | | | | | | | Ractor changes the interpreter's running mode so now it should not use in test-all process which running with many other tests. Test with a separating process is one idea, but I'm not sure the ruby/ostruct can use this trick.
* [ruby/ostruct] Improved YAML serialization.Marc-Andre Lafortune2020-09-301-0/+21
| | | | Patch adapted from Pietro Monteiro [Fixes bug#8382]
* [ruby/ostruct] Add test that frozen OpenStructs are Ractor-shareableMarc-Andre Lafortune2020-09-301-0/+11
|
* [ruby/ostruct] Protect subclass' methods and our bang methods.Marc-Andre Lafortune2020-09-301-1/+23
| | | | Internally, use only bang methods
* [ruby/ostruct] Avoid calling initializeMarc-Andre Lafortune2020-09-301-0/+9
|
* test/ostruct/test_ostruct.rb: Prevent "method redefined; discarding old foo"Yusuke Endoh2020-09-241-0/+3
|
* Fix typos [ci skip]Kazuhiro NISHIYAMA2020-09-171-2/+2
| | | | s/overriden/overridden/
* [ruby/ostruct] Avoid self calling our public methods.Marc-Andre Lafortune2020-09-141-0/+18
| | | | | Found because `json` has a bad example in its test suite. This implementation still offers better encapsulation.
* [ruby/ostruct] Reinstate recent changesMarc-Andre Lafortune2020-09-141-0/+16
| | | | This reverts commit 28e60b0045b5732bca11012d81a5223001faa6b2.
* [ruby/ostruct] Revert recent changesMarc-Andre Lafortune2020-09-141-16/+0
| | | | This reverts commit e026e186f4..12a2e32d43.
* [ruby/ostruct] Add access to public instance methods in case they are overridenMarc-Andre Lafortune2020-09-141-0/+5
|
* [ruby/ostruct] Allow overriding public methodsMarc-Andre Lafortune2020-09-141-0/+6
| | | | [Fixes https://bugs.ruby-lang.org/issues/15409]
* [ruby/ostruct] Add really basic test that was missingMarc-Andre Lafortune2020-09-141-0/+5
|
* [ruby/ostruct] Revert "ostruct.rb: deferred accessors"Marc-Andre Lafortune2020-09-141-1/+6
| | | | | | | | | | | | This reverts commits: dc38e99813 22c082fcfd b499e0f9ff 58e5876646 Add test for overriden private methods [Fixes https://bugs.ruby-lang.org/issues/12136]
* lib/ostruct.rb: Revert "To use RuntimeError instead of FrozenError for old ↵Marc-Andre Lafortune2020-09-041-4/+3
| | | | | | ruby versions." This reverts commit 4cd1fc8b3559353069860eee90b1b5bade013917.
* Prefer dedicated assertion methodNobuyoshi Nakada2020-02-251-1/+1
|
* ostruct.rb: Accept block for to_h [#15451].marcandre2018-12-221-0/+7
| | | | | | Patch by Shuji Kobayashi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support old versions of Ruby with FrozenError.hsbt2018-08-071-3/+4
| | | | | | They should work separatedly from Ruby core repository. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/ostruct.rb: Use `FrozenError` instead of `RuntimeError`.marcandre2018-02-061-3/+3
| | | | | | | | | | | Patch by Yuuji Yaginuma. [Fixes GH-1808] In other classes, `FrozenError` will be raised if change the frozen object. In order to match the behavior, I think that `FrozenError` should use in `OpenStruct`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ostruct: Specify frozen_string_literal: true.kazu2017-10-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/ostruct.rb: Use frozen literals.marcandre2017-10-241-0/+2
| | | | | | Patch adapted from Espartaco Palma. [GH-1714] [Bug #14000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: refine visibility failure messagenobu2017-03-281-0/+24
| | | | | | | * lib/ostruct.rb (method_missing): raise an exception with proper visibility message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: fix OpenStruct.allocatenobu2017-03-241-0/+9
| | | | | | | | * lib/ostruct.rb (OpenStruct.allocate): initialize an instance variable directly, without calling `intialize` method which may be overridden in a subclass. [ruby-core:80292] [Bug #13358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/ostruct.rb: Fix returned value of each_pair.marcandre2017-02-031-0/+1
| | | | | | From a patch by Marcus Stollsteimer. [Fixes #13169] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_ostruct.rb: sort method namesnobu2016-01-041-1/+1
| | | | | | | * test/ostruct/test_ostruct.rb (test_accessor_defines_method): should not depend on the order of methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Fix case of frozen object with initializer.marcandre2016-01-011-1/+2
| | | | | | Bug revealed by RubySpec [ruby-core:72639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Fix new_ostruct_member to correctly avoid redefinitionmarcandre2015-12-311-0/+17
| | | | | | [#11901] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: respond_to?nobu2015-12-291-0/+4
| | | | | | | | * lib/ostruct.rb (OpenStruct): make respond_to? working on just-allocated objects for workaround of Psych. [ruby-core:72501] [Bug #11884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a symbolmarcandre2015-12-121-1/+1
| | | | | | nor a string. See [#11762] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* OpenStruct#dignobu2015-11-171-0/+11
| | | | | | | * lib/ostruct.rb (dig): Implement OpenStruct#dig [Feature #11688] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ostruct/test_ostruct.rb: Add tests for OpenStruct#respond_to.eregon2015-10-141-0/+13
| | | | | | Patch by @jeremy in [GH-1041]: https://github.com/ruby/ruby/pull/1041 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert GH-808nobu2015-01-081-6/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: append suffixes to protected methodsnobu2015-01-051-0/+6
| | | | | | | | * lib/ostruct.rb (modifiable?, new_ostruct_member!, table!): append suffixes to protected methods so that they will not clash with assigned members. [Fix GH-806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warnings: ambiguous first argument; put parentheses or even spacesnaruse2013-11-061-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: raise NoMethodError with a #name and #args.marcandre2013-10-231-0/+10
| | | | | | | | Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (Struct#each_pair): Return an enumerator with sizemarcandre2013-10-231-0/+1
| | | | | | | | Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (OpenStruct#delete): Use the converted argument.marcandre2013-10-231-0/+10
| | | | | | | | Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Raise RuntimeError when modifying frozen instancesmarcandre2013-10-231-3/+3
| | | | | | | | instead of TypeError. Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Add [] and []=, base on a patch by Thomas Sawyermarcandre2012-10-281-6/+11
| | | | | | [ruby-core:42779] [Feature #6056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Also accept {Open}Struct as argument to newmarcandre2012-10-281-0/+7
| | | | | | [ruby-core:47476] [Feature #7007] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Add OpenStruct#eql? and OpenStruct#hashmarcandre2012-10-281-0/+10
| | | | | | [ruby-core:42651] [Bug #6029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (each_pair): Add #each_pair [#1400]marcandre2012-10-281-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c, object.c, struct.c, lib/ostruct.rb: add to_h methods.nobu2012-04-241-0/+12
| | | | | | | [Feature #6276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (delete_field): Bug fix so previous value is returned.marcandre2012-02-221-1/+2
| | | | | | | | Patch by Nick Recobra [Bug #6063] * test/ostruct/test_ostruct.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (method_missing): Handle [] and []= correctly.marcandre2011-05-271-0/+11
| | | | | | Based on a patch by Caius Durling, bug #4179 [ruby-core:33792] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (OpenStruct#delete_field): also undefinenobu2010-11-031-0/+13
| | | | | | accessor methods. [ruby-core:33010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e