Skip to content

Commit 9552fb2

Browse files
author
Brian J. Cardiff
authored
Specs: check non hidden files are not pruned (#330)
1 parent 642cc5b commit 9552fb2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/integration/prune_test.cr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ class PruneCommandTest < Minitest::Test
2727
end
2828

2929
def test_wont_remove_files
30-
File.write(File.join(application_path, "lib", "keep"), "")
30+
File.write(File.join(application_path, "lib", ".keep_hidden"), "")
31+
File.write(File.join(application_path, "lib", "keep_not_hidden"), "")
3132
Dir.cd(application_path) { run "shards prune" }
32-
assert_equal ["keep", "web"], installed_dependencies.sort
33+
assert_equal [".keep_hidden", "keep_not_hidden", "web"], installed_dependencies.sort
3334
end
3435

3536
private def installed_dependencies
36-
Dir[File.join(application_path, "lib", "*")].map { |path| File.basename(path) }
37+
Dir.glob(File.join(application_path, "lib", "*"), match_hidden: true).map { |path| File.basename(path) }
3738
end
3839
end

0 commit comments

Comments
 (0)