mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
rspec's new expect {}
syntax replaces this nicely.
This commit is contained in:
parent
f7f8ef2cd3
commit
4205280099
4 changed files with 10 additions and 11 deletions
|
@ -66,13 +66,13 @@ module DatabaseCleaner
|
|||
end
|
||||
|
||||
it "should raise an error when :only and :except options are used" do
|
||||
expect(running {
|
||||
expect {
|
||||
Truncation.new(:except => ['widgets'], :only => ['widgets'])
|
||||
}).to raise_error(ArgumentError)
|
||||
}.to raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "should raise an error when invalid options are provided" do
|
||||
expect(running { Truncation.new(:foo => 'bar') }).to raise_error(ArgumentError)
|
||||
expect { Truncation.new(:foo => 'bar') }.to raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "should not truncate views" do
|
||||
|
|
|
@ -74,7 +74,7 @@ module DatabaseCleaner
|
|||
let(:cleaner) { DatabaseCleaner::Base.new :autodetect }
|
||||
|
||||
it "should raise an error when no ORM is detected" do
|
||||
expect(running { cleaner }).to raise_error(DatabaseCleaner::NoORMDetected)
|
||||
expect { cleaner }.to raise_error(DatabaseCleaner::NoORMDetected)
|
||||
end
|
||||
|
||||
it "should detect ActiveRecord first" do
|
||||
|
|
|
@ -18,21 +18,21 @@ module DatabaseCleaner
|
|||
end
|
||||
|
||||
it "should raise an error when the :only option is used" do
|
||||
expect(running {
|
||||
expect {
|
||||
Truncation.new(:only => ['document-type'])
|
||||
}).to raise_error(ArgumentError)
|
||||
}.to raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "should raise an error when the :except option is used" do
|
||||
expect(running {
|
||||
expect {
|
||||
Truncation.new(:except => ['document-type'])
|
||||
}).to raise_error(ArgumentError)
|
||||
}.to raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "should raise an error when invalid options are provided" do
|
||||
expect(running {
|
||||
expect {
|
||||
Truncation.new(:foo => 'bar')
|
||||
}).to raise_error(ArgumentError)
|
||||
}.to raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -10,4 +10,3 @@ RSpec.configure do |config|
|
|||
config.run_all_when_everything_filtered = true
|
||||
end
|
||||
|
||||
alias running lambda
|
||||
|
|
Loading…
Reference in a new issue