mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
NullStrategy.cleaning should LocalJumpError without a block, like the other strategies
This commit is contained in:
parent
ea925ec33b
commit
73dcfef9e5
2 changed files with 4 additions and 4 deletions
|
@ -12,9 +12,9 @@ module DatabaseCleaner
|
|||
# no-op
|
||||
end
|
||||
|
||||
def self.cleaning
|
||||
def self.cleaning(&block)
|
||||
# no-op
|
||||
yield if block_given?
|
||||
yield
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,8 +11,8 @@ module DatabaseCleaner
|
|||
end
|
||||
|
||||
describe '.cleaning' do
|
||||
it 'no-ops without a block' do
|
||||
expect { NullStrategy.cleaning }.not_to raise_error(LocalJumpError)
|
||||
it 'fails without a block' do
|
||||
expect { NullStrategy.cleaning }.to raise_error(LocalJumpError)
|
||||
end
|
||||
|
||||
it 'no-ops with a block' do
|
||||
|
|
Loading…
Reference in a new issue