mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
proxies all arguments to clean_with, adds missing aliases
This commit is contained in:
parent
19ed429bf8
commit
de440ecdf0
3 changed files with 9 additions and 5 deletions
|
@ -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"]
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue