Sha256: 5eaef17279314265d4afe0283f3399e8bf1f84572022fbf284db5d7394657266

Contents?: true

Size: 514 Bytes

Versions: 18

Compression:

Stored size: 514 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Sinclair::Comparable do
  describe '#readme' do
    describe '.comparable_by?' do
      let(:model_class) do
        Class.new(SampleModel) do
          include Sinclair::Comparable

          comparable_by :name
        end
      end

      it 'regular usage' do
        model1 = model_class.new(name: 'jack', age: 21)
        model2 = model_class.new(name: 'jack', age: 23)

        expect(model1 == model2).to be_truthy
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-2.1.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-2.0.1 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-2.0.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.16.3 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.16.2 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.16.1 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.16.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.15.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.14.2 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.14.1 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.14.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.13.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.12.1 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.12.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.11.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.10.0 spec/integration/readme/sinclair/comparable_spec.rb
sinclair-1.9.0 spec/integration/readme/sinclair/comparable_spec.rb