summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-02-18 15:34:35 +0200
committerPaul Buetow <paul@buetow.org>2025-02-18 15:34:35 +0200
commit06ce663886c56b96ef25b31f0463e2207f7321fd (patch)
treef1d07445c1680d0e6737c15bdd0020c7b9126bd1 /test
parentfdbd63c6798c6c92b482d03b1f197cbeb41a5448 (diff)
add support to delete a file
Diffstat (limited to 'test')
-rw-r--r--test/lib/dslkeywords/file_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lib/dslkeywords/file_test.rb b/test/lib/dslkeywords/file_test.rb
index 60b659e..d8bbc49 100644
--- a/test/lib/dslkeywords/file_test.rb
+++ b/test/lib/dslkeywords/file_test.rb
@@ -24,6 +24,23 @@ class RCMFileTest < Minitest::Test
assert_equal arr.join("\n"), File.read(FILE_PATH)
end
+ def test_file_absent
+ configure_from_scratch do
+ file :create_file do
+ path FILE_PATH
+ is :present
+ :text
+ end
+
+ file :delete_file do
+ path FILE_PATH
+ is :absent
+ end
+ end
+
+ refute File.file?(FILE_PATH)
+ end
+
def test_create_file_from_sourcefile
text = 'Hello World!'
source_path = "#{FILE_PATH}.source.rcmtmp"