Sha256: 0a99b78f3f21648a2c8c44e9a24578a43ca058b41ba4c0ae1e7916fd5b7c554b

Contents?: true

Size: 858 Bytes

Versions: 10

Compression:

Stored size: 858 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require File.expand_path('../shared/iteration', __FILE__)

describe "Hash#each_value" do
=begin self
  it "returns self" do
    h = new_hash(:a => -5, :b => -3, :c => -2, :d => -1, :e => -1)
    h.each_value { |v|  }.should equal(h)
  end
=end
  
  it "calls block once for each key, passing value" do
    r = []
    h = new_hash(:a => -5, :b => -3, :c => -2, :d => -1, :e => -1)
    h.each_value { |v| r << v }
    r.sort.should == [-5, -3, -2, -1, -1]
  end

  it "processes values in the same order as values()" do
    values = []
    h = new_hash(:a => -5, :b => -3, :c => -2, :d => -1, :e => -1)
    h.each_value { |v| values << v }
    values.should == h.values.to_a
  end

  it_behaves_like(:hash_iteration_no_block, :each_value)
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
jactive_support-2.1.2 spec/java_ext/map/each_value_spec.rb
jactive_support-3.0.0 spec/java_ext/map/each_value_spec.rb
jactive_support-3.0.0.pre2 spec/java_ext/map/each_value_spec.rb
jactive_support-3.0.0.pre1 spec/java_ext/map/each_value_spec.rb
jactive_support-2.1.1 spec/java_ext/map/each_value_spec.rb
jactive_support-2.1.0 spec/java_ext/map/each_value_spec.rb
jactive_support-2.0.0 spec/java_ext/map/each_value_spec.rb
jactive_support-1.0.2 spec/java_ext/map/each_value_spec.rb
jactive_support-1.0.1-universal-java-1.6 spec/java_ext/map/each_value_spec.rb
jactive_support-1.0.0-universal-java-1.6 spec/java_ext/map/each_value_spec.rb