Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e7da5df8b9e9
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02043eda9b4d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Oct 20, 2016

  1. Copy the full SHA
    3036d17 View commit details
  2. [Truffle] Untag passing spec.

    eregon committed Oct 20, 2016
    Copy the full SHA
    02043ed View commit details
Showing with 10 additions and 19 deletions.
  1. +10 −18 spec/ruby/core/hash/assoc_spec.rb
  2. +0 −1 spec/truffle/tags/core/hash/assoc_tags.txt
28 changes: 10 additions & 18 deletions spec/ruby/core/hash/assoc_spec.rb
Original file line number Diff line number Diff line change
@@ -21,24 +21,16 @@
@h.assoc(:banana).last.should == :yellow
end

ruby_version_is ''...'2.2' do
it "only returns the first matching key-value pair for identity hashes" do
@h.compare_by_identity
@h['pear'] = :red
@h['pear'] = :green
@h.keys.grep(/pear/).size.should == 2
@h.assoc('pear').should == ['pear', :red]
end
end

ruby_version_is '2.2' do
it "only returns the first matching key-value pair for identity hashes" do
@h.compare_by_identity
@h['pear'] = :red
@h['pear'] = :green
@h.keys.grep(/pear/).size.should == 1
@h.assoc('pear').should == ['pear', :green]
end
it "only returns the first matching key-value pair for identity hashes" do
# Avoid literal String keys in Hash#[]= due to https://bugs.ruby-lang.org/issues/12855
h = {}.compare_by_identity
k1 = 'pear'
h[k1] = :red
k2 = 'pear'
h[k2] = :green
h.size.should == 2
h.keys.grep(/pear/).size.should == 2
h.assoc('pear').should == ['pear', :red]
end

it "uses #== to compare the argument to the keys" do
1 change: 0 additions & 1 deletion spec/truffle/tags/core/hash/assoc_tags.txt

This file was deleted.