Sha256: 91f00df4f2bfc7d62abca00807ffd4ce57d0958c55a243b708b9b48df0ddee2b

Contents?: true

Size: 649 Bytes

Versions: 4

Compression:

Stored size: 649 Bytes

Contents

require 'spec_helper'

describe Hash do
  context "select_keys" do
    it "debería tomar los values de las keys indicadas" do
      hash = Hash[1, 2, 3, 4]
      hash.select_keys(1).should == {1 => 2}
      hash.select_keys(1, 3).should == {1 => 2, 3 => 4}
      hash.select_keys(5).should == {}
      hash.select_keys(5, 3).should == {3 => 4}
    end
  end
  
  context "has_entries?" do
    subject { Hash[1, 2, 3, 4] }
    
    it "debería devolver true cuando self incluye todas las entries del hash parametro" do
      should have_entries 1 => 2
      should have_entries 3 => 4, 1 => 2
      should_not have_entries 1 => 3
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
afipws-1.0.3 spec/afipws/core_ext/hash_spec.rb
afipws-1.0.2 spec/afipws/core_ext/hash_spec.rb
afipws-1.0.1 spec/afipws/core_ext/hash_spec.rb
afipws-1.0.0 spec/afipws/core_ext/hash_spec.rb