Permalink
Browse files

Merge pull request #5 from mbj/feature/general-shared-adapter-spec

Compatiblitiy with datamapper/dm-core#119
  • Loading branch information...
2 parents d9b8008 + f3f12db commit 641cb9bfd761263385097ca9cef8c070f801b3d1 @solnic solnic committed Jan 8, 2012
Showing with 11 additions and 13 deletions.
  1. +11 −13 spec/adapter_spec.rb
View
@@ -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

0 comments on commit 641cb9b

Please sign in to comment.