Sha256: 809b797188075e3a7540d613bed60591791528f44343f1fdc14106fb023953b5

Contents?: true

Size: 783 Bytes

Versions: 4

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'fortnox/api/mappers/base/canonical_name_sym'

describe Fortnox::API::Mapper::CanonicalNameSym do
  describe '.canonical_name_sym' do
    context 'with simple class' do
      using_test_class do
        class TestClass
          extend Fortnox::API::Mapper::CanonicalNameSym
        end
      end

      subject { TestClass.canonical_name_sym }

      it { is_expected.to eq(:testclass) }
    end

    context 'when class included in module' do
      using_test_class do
        module Something
          class Test
            extend Fortnox::API::Mapper::CanonicalNameSym
          end
        end
      end

      subject { Something::Test.canonical_name_sym }

      it { is_expected.to eq(:test) }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fortnox-api-0.8.0 spec/fortnox/api/mappers/base/canonical_name_sym_spec.rb
fortnox-api-0.7.2 spec/fortnox/api/mappers/base/canonical_name_sym_spec.rb
fortnox-api-0.7.1 spec/fortnox/api/mappers/base/canonical_name_sym_spec.rb
fortnox-api-0.7.0 spec/fortnox/api/mappers/base/canonical_name_sym_spec.rb