summaryrefslogtreecommitdiff
path: root/test/ostruct
AgeCommit message (Collapse)Author
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
2012-10-28* lib/ostruct.rb: Add [] and []=, base on a patch by Thomas Sawyermarcandre
[ruby-core:42779] [Feature #6056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28* lib/ostruct.rb: Also accept {Open}Struct as argument to newmarcandre
[ruby-core:47476] [Feature #7007] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28* lib/ostruct.rb: Add OpenStruct#eql? and OpenStruct#hashmarcandre
[ruby-core:42651] [Bug #6029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28* lib/ostruct.rb (each_pair): Add #each_pair [#1400]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-24* hash.c, object.c, struct.c, lib/ostruct.rb: add to_h methods.nobu
[Feature #6276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22* lib/ostruct.rb (delete_field): Bug fix so previous value is returned.marcandre
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
2011-05-27* lib/ostruct.rb (method_missing): Handle [] and []= correctly.marcandre
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
2010-11-03* lib/ostruct.rb (OpenStruct#delete_field): also undefinenobu
accessor methods. [ruby-core:33010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27* lib/ostruct.rb (modifiable): check if really frozen.nobu
[ruby-core:22559] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17* test/ostruct/test_ostruct.rb (test_frozen): added assertions.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-15* lib/ostruct.rb (OpenStruct#new_ostruct_member): checks if frozen.nobu
[ruby-talk:328195], [ruby-core:22142] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13* lib/ostruct.rb (OpenStruct#inspect): fixed the recursion check.yugui
Patch by Kornelius Kalnbach. [ruby-core:20992]. * test/ostruct/test_ostruct.rb: test for inspect. Patch by Kornelius Kalnbach. [ruby-core:20992]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-25 * lib/ostruct.rb: Added OpenStruct#==.ntalbott
* test/ostruct/test_ostruct.rb: Added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e