Sha256: 425a6289f47f08b67f2e8dbfd1038f4e1e45f1013e429498c6fe9d6317f589c4

Contents?: true

Size: 492 Bytes

Versions: 8

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: false

require 'spec_helper'

describe 'yard Sinclair::Caster::ClassMethods' do
  let(:my_caster) { Class.new(superclass) }

  let(:superclass) do
    Class.new(Sinclair::Caster) do
      cast_with(:string, :to_s)
    end
  end

  describe '.master_caster!' do
    it 'Making a class to be a master caster' do
      expect(my_caster.cast(10, :string)).to eq('10')

      my_caster.master_caster!

      expect(my_caster.cast(10, :string)).to eq(10)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/integration/yard/sinclair/caster/class_methods_spec.rb
sinclair-2.1.0 spec/integration/yard/sinclair/caster/class_methods_spec.rb
sinclair-2.0.1 spec/integration/yard/sinclair/caster/class_methods_spec.rb
sinclair-2.0.0 spec/integration/yard/sinclair/caster/class_methods_spec.rb
sinclair-1.16.3 spec/integration/yard/sinclair/caster/class_methods_spec.rb
sinclair-1.16.2 spec/integration/yard/sinclair/caster/class_methods_spec.rb
sinclair-1.16.1 spec/integration/yard/sinclair/caster/class_methods_spec.rb
sinclair-1.16.0 spec/integration/yard/sinclair/caster/class_methods_spec.rb