Sha256: 78ffb0416ac7d9d8be8d80135aaa3d57e208f50e0d08adc32008a4a1d54f5842

Contents?: true

Size: 779 Bytes

Versions: 7

Compression:

Stored size: 779 Bytes

Contents

# frozen_string_literal: true

#
# Copyright (c) 2019-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

require 'spec_helper'

describe Dbee::Model::Constraints::Static do
  context 'equality' do
    let(:config) { { name: 'type', value: 'general' } }

    subject { described_class.new(config) }

    specify '#hash produces same output as concatenated string hash of name and parent' do
      expect(subject.hash).to eq("#{config[:name].hash}#{config[:value]}".hash)
    end

    specify '#== and #eql? compare attributes' do
      object2 = described_class.new(config)

      expect(subject).to eq(object2)
      expect(subject).to eql(object2)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dbee-1.0.2 spec/dbee/model/constraints/static_spec.rb
dbee-1.0.1 spec/dbee/model/constraints/static_spec.rb
dbee-1.0.0 spec/dbee/model/constraints/static_spec.rb
dbee-1.0.0.pre.alpha.3 spec/dbee/model/constraints/static_spec.rb
dbee-1.0.0.pre.alpha.2 spec/dbee/model/constraints/static_spec.rb
dbee-1.0.0.pre.alpha.1 spec/dbee/model/constraints/static_spec.rb
dbee-1.0.0.pre.alpha spec/dbee/model/constraints/static_spec.rb