Sha256: 4c1593d0c7f36dd4f7d3b38650b194a4483ffbf3a4be7cb1c973c76da6cceeb8

Contents?: true

Size: 696 Bytes

Versions: 14

Compression:

Stored size: 696 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Axiom::Types::Boolean, '.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

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

    it { should be(object) }
  end

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

    it { should be(object) }
  end

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

    it { should be_nil }
  end

  context 'when the argument is not nil' do
    let(:arg) { 1 }

    it { should be_nil }
  end
end

Version data entries

14 entries across 12 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/boolean/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/boolean/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/boolean/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/boolean/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/boolean/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/boolean/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/boolean/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/boolean/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/boolean/class_methods/infer_spec.rb
axiom-types-0.1.1 spec/unit/axiom/types/boolean/class_methods/infer_spec.rb
axiom-types-0.1.0 spec/unit/axiom/types/boolean/class_methods/infer_spec.rb
axiom-types-0.0.5 spec/unit/axiom/types/boolean/class_methods/infer_spec.rb
axiom-types-0.0.4 spec/unit/axiom/types/boolean/class_methods/infer_spec.rb
axiom-types-0.0.3 spec/unit/axiom/types/boolean/class_methods/infer_spec.rb