Sha256: 317353658179b219591253163bbd71ae639ada7128a1500ff9e98fd163f36095

Contents?: true

Size: 498 Bytes

Versions: 15

Compression:

Stored size: 498 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Axiom::Types::Type, '.infer' do
  subject { object.infer(arg) }

  let(:object) { described_class }

  context 'when the argument is the type object' do
    let(:arg) { object }

    it { should be(object) }
  end

  Axiom::Types::Type.descendants.each do |descendant|
    context "when the argument is #{descendant}" do
      let(:arg) { descendant }

      it 'does not match any other type' do
        should be_nil
      end
    end
  end
end

Version data entries

15 entries across 13 versions & 4 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/type/class_methods/infer_spec.rb
axiom-types-0.1.1 spec/unit/axiom/types/type/class_methods/infer_spec.rb
axiom-types-0.1.0 spec/unit/axiom/types/type/class_methods/infer_spec.rb
axiom-types-0.0.5 spec/unit/axiom/types/type/class_methods/infer_spec.rb
axiom-types-0.0.4 spec/unit/axiom/types/type/class_methods/infer_spec.rb
axiom-types-0.0.3 spec/unit/axiom/types/type/class_methods/infer_spec.rb
axiom-types-0.0.2 spec/unit/axiom/types/type/class_methods/infer_spec.rb