aboutsummaryrefslogtreecommitdiffstats
path: root/test/ostruct
Commit message (Collapse)AuthorAgeFilesLines
* 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
* * lib/ostruct.rb (modifiable): check if really frozen.nobu2009-02-271-0/+4
| | | | | | | [ruby-core:22559] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ostruct/test_ostruct.rb (test_frozen): added assertions.nobu2009-02-171-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (OpenStruct#new_ostruct_member): checks if frozen.nobu2009-02-151-0/+8
| | | | | | | [ruby-talk:328195], [ruby-core:22142] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (OpenStruct#inspect): fixed the recursion check.yugui2009-01-131-0/+14
| | | | | | | | | 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
* * lib/ostruct.rb: Added OpenStruct#==.ntalbott2003-09-251-0/+23
* test/ostruct/test_ostruct.rb: Added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e