Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenStruct's exception, special-string, Enumerator#size #383

Closed
wants to merge 4 commits into from

Conversation

kachick
Copy link
Member

@kachick kachick commented Aug 17, 2013

No description provided.

* lib/ostruct.rb (OpenStruct#modifiable): Builtin classies raises
  RuntimeError on frozen instance. TypeError is an old way.

* test/ostruct/test_ostruct.rb: Added tests for above.
* lib/ostruct.rb (OpenStruct#delete_field): Use Symbol instead of
  String. Not only adjusting style. Some special string behave
  `string.to_sym.to_s != string`.

* test/ostruct/test_ostruct.rb: Added tests for above.
* lib/ostruct.rb (OpenStruct#each_pair): Currently, Enumerator has
  size. And Struct#each_pair keeps members-size.

* test/ostruct/test_ostruct.rb: Added tests for above.
* lib/ostruct.rb (OpenStruct#method_missing): NoMethodError
  should have #name and #args.

* test/ostruct/test_ostruct.rb: Added tests for above.
@ghost ghost assigned marcandre Oct 15, 2013
@zzak
Copy link
Member

zzak commented Oct 15, 2013

@marcandre Could you review this when you get a chance?

@marcandre
Copy link
Member

These look really good :+1
I'll triple check and commit them soon.

@marcandre marcandre closed this in b9e18ab Oct 23, 2013
marcandre added a commit that referenced this pull request Oct 23, 2013
  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
marcandre added a commit that referenced this pull request Oct 23, 2013
  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
marcandre added a commit that referenced this pull request Oct 23, 2013
  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
@marcandre
Copy link
Member

These were all great commits. They were committed almost verbatim; I tweaked a bit the commit messages.

There was one test that relied on "+(binary)".to_sym == :+. I didn't know that, thanks! I find it a bit crazy. It will probably make it in my RubyConf talk in a few weeks :-) Anyways, I preferred using a test with a general object that converts to a symbol. I also opened http://bugs.ruby-lang.org/issues/9048

@kachick
Copy link
Member Author

kachick commented Oct 23, 2013

Thanks!
I'm looking forward to your talk :)

@kachick kachick deleted the improve-ostruct branch October 23, 2013 17:05
mmasaki pushed a commit to mmasaki/ruby that referenced this pull request Oct 24, 2013
  instead of TypeError. Patch by Kenichi Kamiya. [Fixes rubyGH-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
mmasaki pushed a commit to mmasaki/ruby that referenced this pull request Oct 24, 2013
  Patch by Kenichi Kamiya. [Fixes rubyGH-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
mmasaki pushed a commit to mmasaki/ruby that referenced this pull request Oct 24, 2013
  Patch by Kenichi Kamiya. [Fixes rubyGH-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
mmasaki pushed a commit to mmasaki/ruby that referenced this pull request Oct 24, 2013
  Patch by Kenichi Kamiya. [Fixes rubyGH-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
kachick added a commit to kachick/rubinius that referenced this pull request Nov 15, 2013
kachick added a commit to kachick/rubinius that referenced this pull request Nov 15, 2013
tenderlove pushed a commit to tenderlove/ruby that referenced this pull request Jan 24, 2014
  instead of TypeError. Patch by Kenichi Kamiya. [Fixes rubyGH-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
tenderlove pushed a commit to tenderlove/ruby that referenced this pull request Jan 24, 2014
  Patch by Kenichi Kamiya. [Fixes rubyGH-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
tenderlove pushed a commit to tenderlove/ruby that referenced this pull request Jan 24, 2014
  Patch by Kenichi Kamiya. [Fixes rubyGH-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
tenderlove pushed a commit to tenderlove/ruby that referenced this pull request Jan 24, 2014
  Patch by Kenichi Kamiya. [Fixes rubyGH-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
kddnewton added a commit to kddnewton/ruby that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants