Sha256: 472663402809e561dbd9a8a6d2a4de4af90c44378d3f24246a492d8f02d97569

Contents?: true

Size: 795 Bytes

Versions: 31

Compression:

Stored size: 795 Bytes

Contents

require 'test_helper'

module Workarea
  class HashUpdateTest < TestCase
    def test_result
      original = { 'foo' => 'bar' }

      result = HashUpdate.new(original: original, adds: %w(key value)).result
      assert_equal(%w(value), result['key'])

      result = HashUpdate.new(original: original, updates: %w(foo baz)).result
      assert_equal(%w(baz), result['foo'])

      result = HashUpdate.new(original: original, removes: %w(foo)).result
      refute_includes(result.keys, 'foo')

      result = HashUpdate.new(original: original, adds: ['key', 'one, two ']).result
      assert_equal(%w(one two), result['key'])

      result = HashUpdate.new(original: original, updates: ['key', 'one,  two, three ']).result
      assert_equal(%w(one two three), result['key'])
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/services/workarea/hash_update_test.rb
workarea-core-3.5.26 test/services/workarea/hash_update_test.rb
workarea-core-3.4.45 test/services/workarea/hash_update_test.rb
workarea-core-3.5.25 test/services/workarea/hash_update_test.rb
workarea-core-3.5.23 test/services/workarea/hash_update_test.rb
workarea-core-3.4.44 test/services/workarea/hash_update_test.rb
workarea-core-3.5.22 test/services/workarea/hash_update_test.rb
workarea-core-3.4.43 test/services/workarea/hash_update_test.rb
workarea-core-3.5.21 test/services/workarea/hash_update_test.rb
workarea-core-3.4.42 test/services/workarea/hash_update_test.rb
workarea-core-3.5.20 test/services/workarea/hash_update_test.rb
workarea-core-3.4.41 test/services/workarea/hash_update_test.rb
workarea-core-3.5.19 test/services/workarea/hash_update_test.rb
workarea-core-3.4.40 test/services/workarea/hash_update_test.rb
workarea-core-3.5.18 test/services/workarea/hash_update_test.rb
workarea-core-3.4.39 test/services/workarea/hash_update_test.rb
workarea-core-3.5.17 test/services/workarea/hash_update_test.rb
workarea-core-3.4.38 test/services/workarea/hash_update_test.rb
workarea-core-3.5.16 test/services/workarea/hash_update_test.rb
workarea-core-3.4.37 test/services/workarea/hash_update_test.rb