Sha256: ee98fc40aef8b719c42c5ea3e882f219981b49070b4b7ebc9232e450138da2f6
Contents?: true
Size: 893 Bytes
Versions: 1
Compression:
Stored size: 893 Bytes
Contents
require 'helper' class TestCoreExtensions < FunWith::Files::TestCase context "testing hash" do should "fwf_reverse_merge nicely" do h = { "1" => 1, "2" => 2 }.fwf_reverse_merge( "3" => 3, "1" => 0 ) assert_equal 1, h["1"] assert_equal 2, h["2"] assert_equal 3, h["3"] h.fwf_reverse_merge!( "1" => "one", "2" => "two", "3" => "three" ) assert_equal 1, h["1"] assert_equal 2, h["2"] assert_equal 3, h["3"] h.fwf_reverse_merge!( "1" => "one", "2" => "two", "3" => "three", "4" => "four" ) assert_equal 1, h["1"] assert_equal 2, h["2"] assert_equal 3, h["3"] assert_equal "four", h["4"] end should "fwf_blank? nicely." do assert_equal false, { 1 => 2 }.fwf_blank? assert_equal true, {}.fwf_blank? assert_equal true, true.fwf_present? end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fun_with_files-0.0.15 | ./test/test_core_extensions.rb |