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.6.1 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.6.0 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.5.2 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.5.1 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.5.0 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.4.2 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.4.0 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.3.0 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.2.8 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.2.7 spec/smarter_csv/extenstions_spec.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/extenstions_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/extenstions_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/extenstions_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/extenstions_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.2.6 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.2.5 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.2.4 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.2.3 spec/smarter_csv/extenstions_spec.rb
smarter_csv-1.2.0 spec/smarter_csv/extenstions_spec.rb