Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Merge pull request #5 from mbj/feature/general-shared-adapter-spec
Browse files Browse the repository at this point in the history
Compatiblitiy with datamapper/dm-core#119
  • Loading branch information
solnic committed Jan 8, 2012
2 parents d9b8008 + f3f12db commit 641cb9b
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions spec/adapter_spec.rb
Expand Up @@ -11,45 +11,43 @@

describe 'DataMapper::Adapters::SqliteAdapter' do

before :all do
@adapter = DataMapper::Spec.adapter
@repository = DataMapper.repository(@adapter.name)
end
let(:adapter) { DataMapper::Spec.adapter }
let(:repository) { DataMapper.repository(adapter.name) }

it_should_behave_like "An Adapter"
it_should_behave_like "A DataObjects Adapter"
it_should_behave_like 'An Adapter'
it_should_behave_like 'A DataObjects Adapter'

describe "with 'sqlite' as adapter name" do
describe 'with "sqlite" as adapter name' do
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite' }) }
it { subject.options[:adapter].should == 'sqlite3' }
end

describe "with 'sqlite3' as adapter name" do
describe 'with "sqlite3" as adapter name' do
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite3' }) }
it { subject.options[:adapter].should == 'sqlite3' }
end

describe "with 'database' given as Symbol" do
describe 'with "database" given as Symbol' do
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite', :database => :name }) }
it { subject.options[:path].should == 'name' }
end

describe "with 'path' given as Symbol" do
describe 'with "path" given as Symbol' do
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite', :path => :name }) }
it { subject.options[:path].should == 'name' }
end

describe "with 'database' given as String" do
describe 'with "database" given as String' do
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite', 'database' => :name }) }
it { subject.options[:path].should == 'name' }
end

describe "with 'path' given as String" do
describe 'with "path" given as String' do
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite', 'path' => :name }) }
it { subject.options[:path].should == 'name' }
end

describe "with blank 'path' and 'database' given as Symbol" do
describe 'with blank "path" and "database" given as Symbol' do
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite', 'path' => '', :database => :name }) }
it { subject.options[:path].should == 'name' }
end
Expand Down

0 comments on commit 641cb9b

Please sign in to comment.