Sha256: a73ab8d41e9079520648fbec56dfe815666968ff82a28c851a07aed75860fdd1

Contents?: true

Size: 522 Bytes

Versions: 4

Compression:

Stored size: 522 Bytes

Contents

require 'spec_helper'
require 'schema_expectations/util'

module SchemaExpectations
  describe SchemaExpectations::Util do
    specify '.slice_hash' do
      expect(Util.slice_hash({}, :key)).to eq({})
      expect(Util.slice_hash({ key: :value }, :key)).to eq(key: :value)
      expect(Util.slice_hash({ other: :value }, :key)).to eq({})
      expect(Util.slice_hash({
        key_1: :value_1,
        key_2: :value_2,
        other: :value_3 }, :key_1, :key_2)).to eq(key_1: :value_1, key_2: :value_2)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
schema_expectations-0.5.0 spec/lib/schema_expectations/util_spec.rb
schema_expectations-0.4.0 spec/lib/schema_expectations/util_spec.rb
schema_expectations-0.3.0 spec/lib/schema_expectations/util_spec.rb
schema_expectations-0.2.0 spec/lib/schema_expectations/util_spec.rb