added basic specs

This commit is contained in:
Corin Langosch 2011-03-30 10:27:03 +02:00
parent f1cddeaeab
commit 29d70b79eb
5 changed files with 68 additions and 0 deletions

View file

@ -32,6 +32,7 @@ group :development do
gem "tzinfo", "0.3.22" gem "tzinfo", "0.3.22"
gem "mongo_mapper", "0.8.2" gem "mongo_mapper", "0.8.2"
gem "couch_potato", "0.3.0" gem "couch_potato", "0.3.0"
gem "sequel", "~>3.21.0"
#gem "ibm_db" # I don't want to add this dependency, even as a dev one since it requires DB2 to be installed #gem "ibm_db" # I don't want to add this dependency, even as a dev one since it requires DB2 to be installed
end end

View file

@ -127,6 +127,7 @@ GEM
linecache (>= 0.3) linecache (>= 0.3)
rubyforge (2.0.4) rubyforge (2.0.4)
json_pure (>= 1.1.7) json_pure (>= 1.1.7)
sequel (3.21.0)
sqlite3-ruby (1.3.1) sqlite3-ruby (1.3.1)
stringex (1.1.0) stringex (1.1.0)
sys-uname (0.8.4) sys-uname (0.8.4)
@ -157,5 +158,6 @@ DEPENDENCIES
rspactor rspactor
rspec rspec
ruby-debug ruby-debug
sequel (~> 3.21.0)
sqlite3-ruby sqlite3-ruby
tzinfo (= 0.3.22) tzinfo (= 0.3.22)

View file

@ -0,0 +1,31 @@
require 'spec_helper'
require 'database_cleaner/sequel/base'
require 'database_cleaner/shared_strategy_spec'
require 'sequel'
module DatabaseCleaner
describe Sequel do
it { should respond_to(:available_strategies) }
end
module Sequel
class ExampleStrategy
include ::DatabaseCleaner::Sequel::Base
end
describe ExampleStrategy do
it_should_behave_like "a generic strategy"
it { should respond_to(:db) }
it { should respond_to(:db=) }
it "should store my desired db" do
subject.db = :my_db
subject.db.should == :my_db
end
it "should default to :default" do
subject.db.should == :default
end
end
end
end

View file

@ -0,0 +1,21 @@
require 'spec_helper'
require 'database_cleaner/sequel/transaction'
require 'database_cleaner/shared_strategy_spec'
require 'sequel'
module DatabaseCleaner
module Sequel
describe Transaction do
it_should_behave_like "a generic strategy"
it_should_behave_like "a generic transaction strategy"
describe "start" do
it "should start a transaction"
end
describe "clean" do
it "should finish a transaction"
end
end
end
end

View file

@ -0,0 +1,13 @@
require 'spec_helper'
require 'database_cleaner/sequel/truncation'
require 'database_cleaner/shared_strategy_spec'
require 'sequel'
module DatabaseCleaner
module Sequel
describe Truncation do
it_should_behave_like "a generic strategy"
it_should_behave_like "a generic truncation strategy"
end
end
end