Sha256: ebd45c9b998a9f766f9a1fa9b377b78fbf486967c9b596d2ab91367c202c77af

Contents?: true

Size: 639 Bytes

Versions: 14

Compression:

Stored size: 639 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

    it { should be(coercion_method) }
  end

  context 'with a symbol' do
    subject { object.coercion_method(symbol) }

    let(:symbol) { :to_string }

    it_should_behave_like 'a command method'

    it 'sets the coercion_method' do
      expect { subject }.to change { object.coercion_method }
        .from(coercion_method).to(symbol)
    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/coercion_method_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/coercion_method_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/coercion_method_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/coercion_method_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/coercion_method_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/coercion_method_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/coercion_method_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/coercion_method_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/coercion_method_spec.rb
axiom-types-0.1.1 spec/unit/axiom/types/object/class_methods/coercion_method_spec.rb
axiom-types-0.1.0 spec/unit/axiom/types/object/class_methods/coercion_method_spec.rb
axiom-types-0.0.5 spec/unit/axiom/types/object/class_methods/coercion_method_spec.rb
axiom-types-0.0.4 spec/unit/axiom/types/object/class_methods/coercion_method_spec.rb
axiom-types-0.0.3 spec/unit/axiom/types/object/class_methods/coercion_method_spec.rb