Sha256: b1e413652b60c31df691a12bcc7631d84012d1fd8bde352af7085e5fe830c011

Contents?: true

Size: 1012 Bytes

Versions: 4

Compression:

Stored size: 1012 Bytes

Contents

require 'spec_helper'
module Alf
  describe Relation, '===' do

    let(:type){ Relation[heading] }

    subject{ type === value }

    context 'when the exact types' do
      let(:heading){ Heading.new(name: String, status: Fixnum) }

      context 'on a valid value built with itself' do
        let(:value){ type.coerce(name: "Smith", status: 20) }

        it{ should be_true }
      end

      context 'on a valid value but built with Relation' do
        let(:value){ Relation.coerce(name: "Smith", status: 20) }

        it{ should be_true }
      end
    end

    context 'with a super type' do
      let(:heading){ Heading.new(name: String, status: Integer) }

      context 'on a valid value built with itself' do
        let(:value){ type.coerce(name: "Smith", status: 20) }

        it{ should be_true }
      end

      context 'on a valid value but built with Relation' do
        let(:value){ Relation.coerce(name: "Smith", status: 20) }

        it{ should be_true }
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-relation/relation/factored-types/test_triple_equal.rb
alf-core-0.14.0 spec/unit/alf-relation/relation/factored-types/test_triple_equal.rb
alf-core-0.13.1 spec/unit/alf-relation/relation/factored-types/test_triple_equal.rb
alf-core-0.13.0 spec/unit/alf-relation/relation/factored-types/test_triple_equal.rb