forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / ma / maid / test.nix
blob722481f2dfcb2a98cd727a6f539815592b51899f
1 { runCommandLocal, maid }:
3 runCommandLocal "test-maid-run" {
4   nativeBuildInputs = [ maid ];
6   ''
7     mkdir -p $out/test
8     export HOME=$out
9     cd $out
10     touch test/a.iso test/b.txt
11     cat > rules.rb <<EOF
12       Maid.rules do
13         rule 'ISO' do
14           trash(dir('test/*.iso'))
15         end
16       end
17     EOF
18     maid clean --rules rules.rb --force
19     [ -f test/b.txt ] && [ ! -f test/a.iso ]
20   ''