Sha256: 73a2f1426c9cac97d369c62ea17e391e1df12e8dfec18b81c6fc8b51a9ffb07e

Contents?: true

Size: 609 Bytes

Versions: 14

Compression:

Stored size: 609 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Axiom::Types::Object, '.primitive' do
  let(:object)    { Class.new(described_class) }
  let(:primitive) { ::BasicObject              }

  context 'with no arguments' do
    subject { object.primitive }

    it { should be(primitive) }
  end

  context 'with a class' do
    subject { object.primitive(klass) }

    let(:klass) { ::String }

    it_should_behave_like 'a command method'

    it 'sets the primitive' do
      expect { subject }.to change { object.primitive.object_id }
        .from(primitive.object_id).to(klass.object_id)
    end
  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/object/class_methods/primitive_spec.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/object/class_methods/primitive_spec.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/object/class_methods/primitive_spec.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/object/class_methods/primitive_spec.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/axiom-types-0.1.1/spec/unit/axiom/types/object/class_methods/primitive_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/object/class_methods/primitive_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/object/class_methods/primitive_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/object/class_methods/primitive_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/object/class_methods/primitive_spec.rb
axiom-types-0.1.1 spec/unit/axiom/types/object/class_methods/primitive_spec.rb
axiom-types-0.1.0 spec/unit/axiom/types/object/class_methods/primitive_spec.rb
axiom-types-0.0.5 spec/unit/axiom/types/object/class_methods/primitive_spec.rb
axiom-types-0.0.4 spec/unit/axiom/types/object/class_methods/primitive_spec.rb
axiom-types-0.0.3 spec/unit/axiom/types/object/class_methods/primitive_spec.rb