Sha256: 65d631a61017ef9b3f4475d9753d441b8e1f49978e3464958ada84b81f23e784

Contents?: true

Size: 948 Bytes

Versions: 2

Compression:

Stored size: 948 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '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 'should have a name' do
        @adapter.name.should == :abstract
      end
    end

    it 'should set options' do
      @adapter.options.should == {:foo => 'bar'}
    end

    it 'should set naming conventions' do
      @adapter.resource_naming_convention.should == DataMapper::NamingConventions::Resource::UnderscoredAndPluralized
      @adapter.field_naming_convention.should    == DataMapper::NamingConventions::Field::Underscored
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-core-1.0.2 spec/semipublic/adapters/abstract_adapter_spec.rb
dm-core-1.0.1 spec/semipublic/adapters/abstract_adapter_spec.rb