Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

11 lines (10 sloc) 0.323 kb
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe Hash do
describe "#partition" do
it "should partition" do
h1, h2 = {'a' => 1, 'b' => 2, 'c' => 10, 'd' => 20}.partition{|k, v| v >= 10}
h1.should == {'c' => 10, 'd' => 20}
h2.should == {'a' => 1, 'b' => 2}
end
end
end
Jump to Line
Something went wrong with that request. Please try again.