NullStrategy.cleaning should LocalJumpError without a block, like the other strategies

This commit is contained in:
Andy Nicholson 2016-05-23 14:10:22 +10:00
parent ea925ec33b
commit 73dcfef9e5
No known key found for this signature in database
GPG key ID: 2B9F43E25E63BC17
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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