proxies all arguments to clean_with, adds missing aliases

This commit is contained in:
Ben Mabey 2010-08-23 15:01:37 -06:00
parent 19ed429bf8
commit de440ecdf0
3 changed files with 9 additions and 5 deletions

View file

@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{database_cleaner}
s.version = "0.6.0.rc.1"
s.version = "0.6.0.rc.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Ben Mabey"]

View file

@ -45,10 +45,14 @@ module DatabaseCleaner
self.connections.each { |connection| connection.clean }
end
def clean_with(stratagem)
self.connections.each { |connection| connection.clean_with stratagem }
alias clean! clean
def clean_with(*args)
self.connections.each { |connection| connection.clean_with(*args) }
end
alias clean_with! clean_with
def remove_duplicates
temp = []
self.connections.each do |connect|

View file

@ -146,8 +146,8 @@ describe ::DatabaseCleaner do
it "should proxy clean_with" do
stratagem = mock("stratgem")
connection.should_receive(:clean_with).with(stratagem)
::DatabaseCleaner.clean_with stratagem
connection.should_receive(:clean_with).with(stratagem, {})
::DatabaseCleaner.clean_with stratagem, {}
end
end