[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>
I'll try to be brief so we can discuss all this. tl;dr: RubySpec is
19 messages
2015/01/05
[#67353] Re: Future of test suites for Ruby
— Tanaka Akira <akr@...>
2015/01/05
2015-01-06 7:18 GMT+09:00 Charles Oliver Nutter <headius@headius.com>:
[#67444] [ruby-trunk - Feature #10718] [Open] IO#close should not raise IOError on closed IO objects. — akr@...
Issue #10718 has been reported by Akira Tanaka.
3 messages
2015/01/09
[#67689] Keyword Arguments — Anthony Crumley <anthony.crumley@...>
Please forgive my ignorance as I am new to MRI development and am still
5 messages
2015/01/20
[#67733] [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5 — normalperson@...
Issue #10761 has been updated by Eric Wong.
4 messages
2015/01/21
[#67736] Re: [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5
— Eric Wong <normalperson@...>
2015/01/22
normalperson@yhbt.net wrote:
[#67772] Preventing Redundant Email Messages — Jeremy Evans <code@...>
For a long time, I've wondered why I sometimes receive redundant email
5 messages
2015/01/23
[ruby-core:67689] Keyword Arguments
From:
Anthony Crumley <anthony.crumley@...>
Date:
2015-01-20 03:56:38 UTC
List:
ruby-core #67689
Please forgive my ignorance as I am new to MRI development and am still
getting familiar with how everything works. I am working on getting the
latest RubySpec tests working with the current MRI codebase. The repo is
at https://github.com/anthonycrumley/rubyspec.
My motivation is to maintain specifications for what MRI actually does
without an opinion on why or how. As a Ruby developer, not an implementor,
my interest is in compatible Ruby implementations which give developers
options that meet their specific application needs. I love Ruby and want
to help. Thanks for everything you do.
Now to my issue...
The spec failure I am currently trying to reconcile with MRI has to do with
testing keyword arguments on blocks. The test at the following url fails
with the messages below.
https://github.com/anthonycrumley/rubyspec/blob/master/language/block_spec.rb#L78-L86
1)
A block yielded a single Array calls #to_hash on the element that maps to
the keyword arguments FAILED
Expected [1, 2, 3, {}]
to equal [1, 2, 3, {:x=>9}]
/vagrant/spec/rubyspec/language/block_spec.rb:85:in `block (3 levels) in
<top (required)>'
/vagrant/spec/rubyspec/language/block_spec.rb:4:in `<top (required)>'
2)
An exception occurred during: Mock.verify_count
A block yielded a single Array calls #to_hash on the element that maps to
the keyword arguments FAILED
Mock 'destructure matching block keyword argument' expected to receive
'to_hash' exactly 1 times
but received it 0 times
/vagrant/spec/rubyspec/language/block_spec.rb:4:in `<top (required)>'
A similar spec that can be found at the following url passes.
https://github.com/anthonycrumley/rubyspec/blob/master/language/block_spec.rb#L62-L68
The difference between the two is that the passing spec has the **k
parameter of the block matched with the LAST value in the array of
parameters. The failing spec has the **k parameter of the block matched
with a value in the middle of the array of parameters. The spec seems to
assume that the method #to_hash will always be called on the array item
that lines up with the **parameter. Should that assumption be valid in MRI
? Is that an implementation specific assumption that does not hold true
for MRI? How should MRI handle the scenario in the failing test?
I am new to all this so any help will be greatly appreciated. Also,
direction on where to look in the MRI codebase to understand how keyword
arguments work in this scenario would be awesome.
Thanks,
Anthony