Sha256: 3dba414137fa81c893e7fc4ffcd2c666cd189660c665d4c3d57b8ff5eacb9d05

Contents?: true

Size: 889 Bytes

Versions: 2

Compression:

Stored size: 889 Bytes

Contents

require_relative '../../spec_helper'

describe 'AbstractAdapter' do
  before :all do
    @adapter = DataMapper::Adapters::AbstractAdapter.new(:abstract, :foo => 'bar')
    @adapter_class = @adapter.class
    @scheme        = DataMapper::Inflector.underscore(DataMapper::Inflector.demodulize(@adapter_class).chomp('Adapter'))
    @adapter_name  = "test_#{@scheme}".to_sym
  end

  describe 'initialization' do

    describe 'name' do
      it 'has a name' do
        expect(@adapter.name).to eq :abstract
      end
    end

    it 'sets options' do
      expect(@adapter.options).to eq({foo: 'bar'})
    end

    it 'sets naming conventions' do
      expect(@adapter.resource_naming_convention).to eq DataMapper::NamingConventions::Resource::UnderscoredAndPluralized
      expect(@adapter.field_naming_convention).to eq DataMapper::NamingConventions::Field::Underscored
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sbf-dm-core-1.3.0 spec/semipublic/adapters/abstract_adapter_spec.rb
sbf-dm-core-1.3.0.beta spec/semipublic/adapters/abstract_adapter_spec.rb