Sha256: 50da55737d93263b391c4a14f86e29f5e82e151c8de0b056f659b0bbac6edad6
Contents?: true
Size: 695 Bytes
Versions: 4
Compression:
Stored size: 695 Bytes
Contents
covers 'facets/hash/graph' testcase Hash do unit :graph! => "using a hash" do a = { :a => 1, :b => 2, :c => 3 } e = { :a => 2, :b => 3, :c => 4 } a.graph!{ |k,v| { k => v+1 } } a.assert == e end unit :graph! => "using an associative array" do h = {:a=>1,:b=>2,:c=>3} h.graph!{ |k,v| [v, v*v] } h.assert == {1=>1, 2=>4, 3=>9} end unit :mash! => "using a hash" do a = { :a => 1, :b => 2, :c => 3 } e = { :a => 2, :b => 3, :c => 4 } a.mash!{ |k,v| { k => v+1 } } a.assert == e end unit :mash! => "using an associative array" do h = {:a=>1,:b=>2,:c=>3} h.mash!{ |k,v| [v, v*v] } h.assert == {1=>1, 2=>4, 3=>9} end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
facets-2.9.1 | test/core/hash/test_graph.rb |
facets-2.9.0 | test/core/hash/test_graph.rb |
facets-2.9.0.pre.2 | test/core/hash/test_graph.rb |
facets-2.9.0.pre.1 | test/core/hash/test_graph.rb |