Sha256: 20a35ceb81f8790a93581426bd65f8d25f24abfce26f2370e7999940bc09b3b4

Contents?: true

Size: 779 Bytes

Versions: 24

Compression:

Stored size: 779 Bytes

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

require 'spec_helper'
require 'cosmos/core_ext/hash'

describe Hash do

  describe "inspect" do
    it "limits the number of items to 10" do
      hash = {'1'=>1,'2'=>2,'3'=>3,'4'=>4,'5'=>5,'6'=>6,'7'=>7,'8'=>8,'9'=>9,'10'=>10}
      expect(hash.inspect).to eql '{"1"=>1, "2"=>2, "3"=>3, "4"=>4, "5"=>5, "6"=>6, "7"=>7, "8"=>8, "9"=>9, "10"=>10}'
      hash['11'] = 11
      expect(hash.inspect).to match(/#<Hash:\d+>/)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
cosmos-4.5.2-java spec/core_ext/hash_spec.rb
cosmos-4.5.2 spec/core_ext/hash_spec.rb
cosmos-4.5.1-java spec/core_ext/hash_spec.rb
cosmos-4.5.1 spec/core_ext/hash_spec.rb
cosmos-4.5.0-java spec/core_ext/hash_spec.rb
cosmos-4.5.0 spec/core_ext/hash_spec.rb
cosmos-4.4.2-java spec/core_ext/hash_spec.rb
cosmos-4.4.2 spec/core_ext/hash_spec.rb
cosmos-4.4.1-java spec/core_ext/hash_spec.rb
cosmos-4.4.1 spec/core_ext/hash_spec.rb
cosmos-4.4.0-java spec/core_ext/hash_spec.rb
cosmos-4.4.0 spec/core_ext/hash_spec.rb
cosmos-4.3.0-java spec/core_ext/hash_spec.rb
cosmos-4.3.0 spec/core_ext/hash_spec.rb
cosmos-4.2.4-java spec/core_ext/hash_spec.rb
cosmos-4.2.4 spec/core_ext/hash_spec.rb
cosmos-4.2.3-java spec/core_ext/hash_spec.rb
cosmos-4.2.3 spec/core_ext/hash_spec.rb
cosmos-4.2.2-java spec/core_ext/hash_spec.rb
cosmos-4.2.2 spec/core_ext/hash_spec.rb