Struct#select allows for non-block arguments
--------------------------------------------
Key: JRUBY-1598
URL: http://jira.codehaus.org/browse/JRUBY-1598
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: Ubuntu Linux 7.10,
ruby 1.8.5 (2007-11-21 rev 4842) [i386-jruby1.1b1]
Reporter: Vladimir Sizikov
Priority: Minor
MRI:
Struct.new("Car", :make).new.select(10){} ==> ArgumentError: wrong number of
arguments (1 for 0)
JRuby:
Struct.new("Car", :make).new.select(10){} ==> [], and no exception thrown.
According to ruby docs, select should be identical to Enumerable#select, which
does not allow for non-block params in both, MRI and JRuby.
This causes one Rubinius spec test to fail:
#> bin/mspec -t jruby spec/core/struct
Struct#select raises ArgumentError if given any non-block arguments FAILED
Expected ArgumentError, nothing raised:
/opt/work/rubinius/./spec/core/struct/../../mspec_helper.rb:27:in `should_raise'
/opt/work/rubinius/./spec/core/struct/select_spec.rb:7:in `should_raise'
/opt/work/rubinius/./spec/core/struct/select_spec.rb:8:in `it'
/opt/work/rubinius/spec/mini_rspec.rb:403:in `it'
/opt/work/rubinius/./spec/core/struct/select_spec.rb:6:in `it'
/opt/work/rubinius/./spec/core/struct/select_spec.rb:6:in `describe'
/opt/work/rubinius/spec/mini_rspec.rb:399:in `describe'
/opt/work/rubinius/./spec/core/struct/select_spec.rb:4:in `describe'
/opt/work/rubinius/./spec/core/struct/select_spec.rb:4:in `load'
last_mspec.rb:11:in `load'
last_mspec.rb:1:in `each'
last_mspec.rb:6:in `each'
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email