Add NoResultsError (#121)

This commit is contained in:
Jeremy Woertink 2020-02-17 13:04:23 -08:00 committed by GitHub
parent f128d6ddf3
commit f08a4da60a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -208,4 +208,13 @@ describe DB::Statement do
db.pool.is_available?(DummyDriver::DummyConnection.connections.first)
end
end
it "raises NoResultsError for scalar" do
with_dummy_connection do |cnn|
stmt = cnn.prepared ""
expect_raises DB::NoResultsError do
stmt.scalar "SELECT LIMIT 0"
end
end
end
end