Skip to content

Commit

Permalink
test: 🧪❌ Add specification for CSV storage
Browse files Browse the repository at this point in the history
- Create a specification for an interface that will connect the app with a CSV file.
  • Loading branch information
Jakub Sobolewski committed Jan 20, 2025
1 parent 6e79158 commit d3adea5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testthat/test-storage.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
box::use(
fs[file_exists],
testthat[...], # nolint
withr[with_tempdir],
)

box::use(
app / storage,
)

describe("new", {
it("should create a new csv storage if csv path is provided", {
with_tempdir({
# Arrange
path <- "store.csv"

# Act
.storage <- storage$new(path, schema = list(amount = numeric()))

# Assert
expect_true(file_exists(.storage))
})
})
})

0 comments on commit d3adea5

Please sign in to comment.