From 2ea74a7ce93bc4759243cb6054b8d70a73e5716a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 18 Feb 2025 12:48:10 +0200 Subject: testing backup --- test/lib/dslkeywords/file_test.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/lib') diff --git a/test/lib/dslkeywords/file_test.rb b/test/lib/dslkeywords/file_test.rb index d0afd92..1a636b8 100644 --- a/test/lib/dslkeywords/file_test.rb +++ b/test/lib/dslkeywords/file_test.rb @@ -68,4 +68,28 @@ class RCMFileTest < Minitest::Test assert File.exist?(file_path) assert_equal :content, File.read(file_path).to_sym end + + def test_backup + file_path = "#{DIR_PATH}/foo/backup-me.txt" + original_content = 'original_content' + backup_path = "#{DIR_PATH}/foo/.rcm/backup-me.txt.d4c3af73588ce06c32ed04d1b79801286109ea265712a2bd3fdc3ed01c82bb86" + + configure_from_scratch do + file :original do + path file_path + create_parent_directory + original_content + end + + file :new do + path file_path + create_parent_directory + depends_on file(:original) + :new_content + end + end + + assert File.file?(backup_path) + assert_equal original_content, File.read(backup_path) + end end -- cgit v1.2.3