@@ -456,3 +456,85 @@ Feature: Generate a distribution archive of a project
456456 """
457457 Success: Created hello-world-dist.zip
458458 """
459+
460+ Scenario : Removes existing files in the ZIP file
461+ Given an empty directory
462+ And a foo/.distignore file:
463+ """
464+ """
465+ And a foo/foo.txt file:
466+ """
467+ Hello Foo
468+ """
469+ And a foo/bar.txt file:
470+ """
471+ Hello Bar
472+ """
473+
474+ When I try `wp dist-archive foo`
475+ Then the foo.zip file should exist
476+
477+ When I try `zipinfo -1 foo.zip`
478+ Then STDOUT should contain:
479+ """
480+ foo/bar.txt
481+ """
482+ And STDOUT should contain:
483+ """
484+ foo/foo.txt
485+ """
486+
487+ When I run `echo "foo.txt" > foo/.distignore`
488+ And I try `wp dist-archive foo --force`
489+ Then the foo.zip file should exist
490+
491+ When I try `zipinfo -1 foo.zip`
492+ Then STDOUT should contain:
493+ """
494+ foo/bar.txt
495+ """
496+ And STDOUT should not contain:
497+ """
498+ foo/foo.txt
499+ """
500+
501+ Scenario : Removes existing files in the tarball
502+ Given an empty directory
503+ And a foo/.distignore file:
504+ """
505+ """
506+ And a foo/foo.txt file:
507+ """
508+ Hello Foo
509+ """
510+ And a foo/bar.txt file:
511+ """
512+ Hello Bar
513+ """
514+
515+ When I try `wp dist-archive foo --format=targz`
516+ Then the foo.tar.gz file should exist
517+
518+ When I try `tar -tf foo.tar.gz`
519+ Then STDOUT should contain:
520+ """
521+ foo/bar.txt
522+ """
523+ And STDOUT should contain:
524+ """
525+ foo/foo.txt
526+ """
527+
528+ When I run `echo "foo.txt" > foo/.distignore`
529+ And I try `wp dist-archive foo --format=targz --force`
530+ Then the foo.tar.gz file should exist
531+
532+ When I try `tar -tf foo.tar.gz`
533+ Then STDOUT should contain:
534+ """
535+ foo/bar.txt
536+ """
537+ And STDOUT should not contain:
538+ """
539+ foo/foo.txt
540+ """
0 commit comments