Sha256: cda2a7ac35ebb9026eba39a542b97d64ef3e73bb092d61a5f1bf53b07f6a8b43

Contents?: true

Size: 480 Bytes

Versions: 22

Compression:

Stored size: 480 Bytes

Contents

require 'spec_helper'

describe "Hash.zip" do
  it "constructs a new Hash from two Arrays" do
    Hash.zip(["a", "b"], [1, 2]).should == { "a" => 1, "b" => 2 }
  end

  it "constructs an empty Hash if given no keys" do
    Hash.zip([], []).should == {}
    Hash.zip([], [1]).should == {}
  end

  it "uses nil values if there are more keys than values" do
    Hash.zip(["a"], []).should == { "a" => nil }
    Hash.zip(["a", "b"], [1]).should == { "a" => 1, "b" => nil }
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
smarter_csv-1.1.5 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.1.4 spec/smarter_csv/extenstions_spec.rb