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"
)
})
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.