Sha256: 8484f6dd829a94cc080c1335fe3d5d1637c9c94a9c5bf615ae283f9744264a82

Contents?: true

Size: 656 Bytes

Versions: 16

Compression:

Stored size: 656 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Axiom::Types::Object, '.finalize' do
  subject { object.finalize }

  let(:object) do
    # Class.new { ... } does not work with this on 1.8.7
    object = Class.new(described_class)
    object.primitive(::String)
    object
  end

  it_should_behave_like 'a command method'
  it_should_behave_like 'an idempotent method'

  it { should be_frozen }

  its(:constraint) { should be_frozen }

  it 'adds a constraint that returns true for a valid primitive' do
    should include('string')
  end

  it 'adds a constraint that returns false for an invalid primitive' do
    should_not include(nil)
  end
end

Version data entries

16 entries across 14 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/finalize_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/finalize_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/finalize_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/finalize_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/finalize_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/finalize_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/finalize_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/finalize_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/finalize_spec.rb
axiom-types-0.1.1 spec/unit/axiom/types/object/class_methods/finalize_spec.rb
axiom-types-0.1.0 spec/unit/axiom/types/object/class_methods/finalize_spec.rb
axiom-types-0.0.5 spec/unit/axiom/types/object/class_methods/finalize_spec.rb
axiom-types-0.0.4 spec/unit/axiom/types/object/class_methods/finalize_spec.rb
axiom-types-0.0.3 spec/unit/axiom/types/object/class_methods/finalize_spec.rb
axiom-types-0.0.2 spec/unit/axiom/types/object/class_methods/finalize_spec.rb
axiom-types-0.0.1 spec/unit/axiom/types/object/class_methods/finalize_spec.rb