aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/hash/shared/values_at.rb
blob: ef3b0e8ba0098b8f4d650a80e1d35a07d82376e3 (plain)
1
2
3
4
5
6
7
8
9
describe :hash_values_at, shared: true do
  it "returns an array of values for the given keys" do
    h = { a: 9, b: 'a', c: -10, d: nil }
    h.send(@method).should be_kind_of(Array)
    h.send(@method).should == []
    h.send(@method, :a, :d, :b).should be_kind_of(Array)
    h.send(@method, :a, :d, :b).should == [9, nil, 'a']
  end
end