Sha256: f1493681696d5c54ba17308e317690c3c7017a1a032207be91842676c6e0fe6a
Contents?: true
Size: 660 Bytes
Versions: 31
Compression:
Stored size: 660 Bytes
Contents
require 'test_helper' module Workarea class HashUpdateTest < TestCase def test_apply hash = { 'foo' => 'bar' } HashUpdate.new(adds: %w(key value)).apply(hash) assert_equal(%w(value), hash['key']) HashUpdate.new(updates: %w(foo baz)).apply(hash) assert_equal(%w(baz), hash['foo']) HashUpdate.new(removes: %w(foo)).apply(hash) refute_includes(hash.keys, 'foo') HashUpdate.new(adds: ['key', 'one, two ']).apply(hash) assert_equal(%w(one two), hash['key']) HashUpdate.new(updates: ['key', 'one, two, three ']).apply(hash) assert_equal(%w(one two three), hash['key']) end end end
Version data entries
31 entries across 31 versions & 1 rubygems