Skip to content

Commit

Permalink
should fix teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Kadis committed Dec 23, 2016
1 parent 31f41c2 commit 41b7415
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions hugo-content-test/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Keep this dir around for unit tests
12 changes: 9 additions & 3 deletions tests/test-write-file.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ function setUp() {
}

function tearDown() {
unlink( './hugo-content-test/2016/12/the-post.md' );
$dirs = array( './2016/12/23', './2016/12', './hugo-content-test/2016/12' );
$test_file = './hugo-content-test/2016/12/the-post.md';
if ( file_exists( $test_file ) ) {
unlink( $test_file );
}

$dirs = array( './2016/12/23', './2016/12', './2016', './hugo-content-test/2016/12', './hugo-content-test/2016' );
foreach ( $dirs as $dir ) {
rmdir( $dir );
if ( is_dir( $dir ) ) {
rmdir( $dir );
}
}
}

Expand Down

0 comments on commit 41b7415

Please sign in to comment.