summaryrefslogtreecommitdiff
path: root/test/ostruct
AgeCommit message (Collapse)Author
2021-07-29Partly picked from ↵Hiroshi SHIBATA
https://github.com/ruby/ostruct/commit/20d0b8c065392a22ba6d74194cf116755f38337f
2021-06-14[lib/ostruct] Fix YAML testMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/4572
2021-06-14[lib/ostruct] Allow overriding of `block_given?`Marc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/4572
2021-06-14Add fallback block to `OpenStruct#delete_field` (#1409)jfrazx
Notes: Merged-By: marcandre <github@marc-andre.ca>
2021-05-17test/ostruct/test_ostruct.rb: Use YAML.unsafe_load instead of YAML.loadYusuke Endoh
Follow-up of fbb4e3f96c10de2240f2d87eac19cf6f62f65fea
2021-04-28Guard for < Ruby 3.0Hiroshi SHIBATA
2021-01-12Fix method protection for modules in the ancestry chain.Marc-Andre Lafortune
[Fixes ruby/ostruct#23]
2021-01-06strip trailing spaces [ci skip]Nobuyoshi Nakada
2021-01-05[ruby/ostruct] Allow ostruct to return a value on super (#4028)Adam Hess
This fixes cases where you can super in something that inherits from OpenStruct Co-authored-by: John Hawthorn <john@hawthorn.email> Notes: Merged-By: marcandre <github@marc-andre.ca>
2020-12-19[ruby/ostruct] Add Ractor testMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3942
2020-10-06[lib/ostruct] Fix Marshal loadingMarc-Andre Lafortune
2020-10-01stop Ractor test in test-allKoichi Sasada
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.
2020-09-30[ruby/ostruct] Improved YAML serialization.Marc-Andre Lafortune
Patch adapted from Pietro Monteiro [Fixes bug#8382] Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Add test that frozen OpenStructs are Ractor-shareableMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Protect subclass' methods and our bang methods.Marc-Andre Lafortune
Internally, use only bang methods Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Avoid calling initializeMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-24test/ostruct/test_ostruct.rb: Prevent "method redefined; discarding old foo"Yusuke Endoh
2020-09-17Fix typos [ci skip]Kazuhiro NISHIYAMA
s/overriden/overridden/
2020-09-14[ruby/ostruct] Avoid self calling our public methods.Marc-Andre Lafortune
Found because `json` has a bad example in its test suite. This implementation still offers better encapsulation. Notes: Merged: https://github.com/ruby/ruby/pull/3541
2020-09-14[ruby/ostruct] Reinstate recent changesMarc-Andre Lafortune
This reverts commit 28e60b0045b5732bca11012d81a5223001faa6b2. Notes: Merged: https://github.com/ruby/ruby/pull/3541
2020-09-14[ruby/ostruct] Revert recent changesMarc-Andre Lafortune
This reverts commit e026e186f4..12a2e32d43.
2020-09-14[ruby/ostruct] Add access to public instance methods in case they are overridenMarc-Andre Lafortune
2020-09-14[ruby/ostruct] Allow overriding public methodsMarc-Andre Lafortune
[Fixes https://bugs.ruby-lang.org/issues/15409]
2020-09-14[ruby/ostruct] Add really basic test that was missingMarc-Andre Lafortune
2020-09-14[ruby/ostruct] Revert "ostruct.rb: deferred accessors"Marc-Andre Lafortune
This reverts commits: dc38e99813 22c082fcfd b499e0f9ff 58e5876646 Add test for overriden private methods [Fixes https://bugs.ruby-lang.org/issues/12136]
2020-09-04lib/ostruct.rb: Revert "To use RuntimeError instead of FrozenError for old ↵Marc-Andre Lafortune
ruby versions." This reverts commit 4cd1fc8b3559353069860eee90b1b5bade013917.
2020-02-25Prefer dedicated assertion methodNobuyoshi Nakada
2018-12-22ostruct.rb: Accept block for to_h [#15451].marcandre
Patch by Shuji Kobayashi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-07Support old versions of Ruby with FrozenError.hsbt
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
2018-02-06lib/ostruct.rb: Use `FrozenError` instead of `RuntimeError`.marcandre
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
2017-10-25test/ostruct: Specify frozen_string_literal: true.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24lib/ostruct.rb: Use frozen literals.marcandre
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
2017-03-28ostruct.rb: refine visibility failure messagenobu
* 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
2017-03-24ostruct.rb: fix OpenStruct.allocatenobu
* 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
2017-02-03lib/ostruct.rb: Fix returned value of each_pair.marcandre
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
2016-01-04test_ostruct.rb: sort method namesnobu
* 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
2016-01-01* lib/ostruct.rb: Fix case of frozen object with initializer.marcandre
Bug revealed by RubySpec [ruby-core:72639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-31* lib/ostruct.rb: Fix new_ostruct_member to correctly avoid redefinitionmarcandre
[#11901] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-29ostruct.rb: respond_to?nobu
* 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
2015-12-16Add frozen_string_literal: false for all filesnaruse
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
2015-12-12* lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a symbolmarcandre
nor a string. See [#11762] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17OpenStruct#dignobu
* 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
2015-10-14* test/ostruct/test_ostruct.rb: Add tests for OpenStruct#respond_to.eregon
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
2015-01-08Revert GH-808nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-05ostruct.rb: append suffixes to protected methodsnobu
* 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
2013-11-06Suppress warnings: ambiguous first argument; put parentheses or even spacesnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23* lib/ostruct.rb: raise NoMethodError with a #name and #args.marcandre
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
2013-10-23* lib/ostruct.rb (Struct#each_pair): Return an enumerator with sizemarcandre
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
2013-10-23* lib/ostruct.rb (OpenStruct#delete): Use the converted argument.marcandre
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
2013-10-23* lib/ostruct.rb: Raise RuntimeError when modifying frozen instancesmarcandre
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