recreating a non-existant database shouldn't raise any exception (and we make sure of it)
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
This commit is contained in:
parent
d5b354367d
commit
ec51c34f7d
2 changed files with 2 additions and 2 deletions
|
@ -265,7 +265,7 @@ module CouchRest
|
||||||
def recreate!
|
def recreate!
|
||||||
delete!
|
delete!
|
||||||
create!
|
create!
|
||||||
rescue HttpAbstraction::ResourceNotFound
|
rescue RestClient::ResourceNotFound
|
||||||
ensure
|
ensure
|
||||||
create!
|
create!
|
||||||
end
|
end
|
||||||
|
|
|
@ -716,7 +716,7 @@ describe CouchRest::Database do
|
||||||
|
|
||||||
it "should recreate a db even tho it doesn't exist" do
|
it "should recreate a db even tho it doesn't exist" do
|
||||||
@cr.databases.should_not include(@db2.name)
|
@cr.databases.should_not include(@db2.name)
|
||||||
begin @db2.recreate! rescue nil end
|
@db2.recreate!
|
||||||
@cr.databases.should include(@db2.name)
|
@cr.databases.should include(@db2.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue