test_that("expect_sql works", { with_mock_db({ con <- dbConnect(RSQLite::SQLite(), dbname = "not_a_db") expect_sql( dbGetQuery(con, "SELECT carrier, name FROM airlines LIMIT 3"), "SELECT carrier, name FROM airlines LIMIT 3" ) expect_sql( dbSendQuery(con, "SELECT carrier, name FROM airlines LIMIT 3"), "SELECT carrier, name FROM airlines LIMIT 3" ) expect_sql( dbExecute(con, "SELECT carrier, name FROM airlines LIMIT 3"), "SELECT carrier, name FROM airlines LIMIT 3" ) }) })