-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #559 from otto-gebb/copy-with-subfolders
Copy with subfolders
- Loading branch information
Showing
3 changed files
with
78 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.IO; | ||
using Fake; | ||
using Machine.Specifications; | ||
|
||
namespace Test.FAKECore.FileHandling | ||
{ | ||
public class when_copying_file_with_subfolders : BaseFunctions | ||
{ | ||
private static readonly string DestinationDir = Path.Combine(TestData.TestDir, "destination"); | ||
|
||
Establish context = CreateTestFileStructure; | ||
Because of = () => FileHelper.CopyFileWithSubfolder( | ||
TestData.TestDir + "/Dir6", | ||
DestinationDir, | ||
Path.Combine(TestData.TestDir, "Dir6/Sub1/file2.nat")); | ||
It should_find_file_in_destination_subfolder = () => | ||
File.Exists(DestinationDir + "/Sub1/file2.nat").ShouldBeTrue(); | ||
} | ||
|
||
public class when_copying_group_of_files_with_subfolders : BaseFunctions | ||
{ | ||
private static readonly string DestinationDir = Path.Combine(TestData.TestDir, "destination"); | ||
|
||
Establish context = CreateTestFileStructure; | ||
Because of = () => FileHelper.CopyWithSubfoldersTo( | ||
DestinationDir, | ||
new [] | ||
{ | ||
FileSystem.SetBaseDir(TestData.TestDir + "/Dir7", FileSystem.Include("**/*.nat")) | ||
}); | ||
It should_find_file_in_destination_folder = () => | ||
File.Exists(DestinationDir + "/file2.nat").ShouldBeTrue(); | ||
It should_find_file_in_destination_subfolder = () => | ||
File.Exists(DestinationDir + "/Sub1/file2.nat").ShouldBeTrue(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters