diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-18 16:01:14 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-18 16:01:14 +0200 |
| commit | a96932d5274537603fc718545b91e54eaedcef05 (patch) | |
| tree | 190d92c1b876ffd44b0815fc49aeb034548b3e25 /test/lib | |
| parent | 06ce663886c56b96ef25b31f0463e2207f7321fd (diff) | |
can clean up a file which is cleaning whole path
Diffstat (limited to 'test/lib')
| -rw-r--r-- | test/lib/dslkeywords/file_test.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lib/dslkeywords/file_test.rb b/test/lib/dslkeywords/file_test.rb index d8bbc49..eaece2d 100644 --- a/test/lib/dslkeywords/file_test.rb +++ b/test/lib/dslkeywords/file_test.rb @@ -41,6 +41,29 @@ class RCMFileTest < Minitest::Test refute File.file?(FILE_PATH) end + def test_file_absent_with_empty_directory + file_path = "#{DIR_PATH}/test_file_absent_with_empty_directory/bar/baz/foo.txt" + + configure_from_scratch do + file :create_file_empty_directory_test do + path file_path + create_parent_directory + is :present + :text + end + + file :delete_file_empty_directory_test do + path file_path + depends_on file :create_file_empty_directory_test + is :clean + end + end + + refute File.file?(file_path) + refute File.directory?(File.dirname(file_path)) + refute File.directory?(File.dirname(File.dirname(file_path))) + end + def test_create_file_from_sourcefile text = 'Hello World!' source_path = "#{FILE_PATH}.source.rcmtmp" |
