|
1 | | -test_that("cpp_vendor errors if cpp11 is not installed", { |
2 | | - pkg <- local_package() |
| 1 | +describe("cpp_vendor", { |
| 2 | + it("errors if cpp11 is not installed", { |
| 3 | + pkg <- local_package() |
| 4 | + mockery::stub(cpp_vendor, "system.file", "") |
| 5 | + expect_error( |
| 6 | + cpp_vendor(pkg_path(pkg)), |
| 7 | + "cpp11 is not installed" |
| 8 | + ) |
| 9 | + }) |
3 | 10 |
|
4 | | - expect_error( |
5 | | - cpp_vendor(pkg_path(pkg), headers = ""), |
6 | | - "cpp11 is not installed" |
7 | | - ) |
8 | | -}) |
9 | | - |
10 | | -test_that("cpp_vendor errors if cpp11 is already vendored", { |
11 | | - pkg <- local_package() |
12 | | - cpp_vendor(pkg_path(pkg)) |
13 | | - |
14 | | - expect_error( |
15 | | - cpp_vendor(pkg_path(pkg)), |
16 | | - "already exists" |
17 | | - ) |
18 | | -}) |
19 | | - |
20 | | -test_that("cpp_vendor vendors cpp11", { |
21 | | - pkg <- local_package() |
22 | | - p <- pkg_path(pkg) |
| 11 | + it("vendors cpp11", { |
| 12 | + pkg <- local_package() |
| 13 | + p <- pkg_path(pkg) |
23 | 14 |
|
24 | | - cpp_vendor(pkg_path(pkg)) |
| 15 | + cpp_vendor(pkg_path(pkg)) |
25 | 16 |
|
26 | | - expect_true(dir.exists(file.path(p, "inst", "include", "cpp11"))) |
27 | | - expect_true(file.exists(file.path(p, "inst", "include", "cpp11.hpp"))) |
28 | | - expect_true(file.exists(file.path(p, "inst", "include", "cpp11", "declarations.hpp"))) |
| 17 | + expect_true(dir.exists(file.path(p, "inst", "include", "cpp11"))) |
| 18 | + expect_true(file.exists(file.path(p, "inst", "include", "cpp11.hpp"))) |
| 19 | + expect_true(file.exists(file.path(p, "inst", "include", "cpp11", "declarations.hpp"))) |
29 | 20 |
|
30 | | - expect_silent(cpp_unvendor(pkg_path(pkg))) |
| 21 | + expect_silent(cpp_unvendor(pkg_path(pkg))) |
| 22 | + }) |
31 | 23 | }) |
0 commit comments