Add symlinkFile to the public AppDir interface (#42)

* Add symlinkFile to the public AppDir interface

* Rename AppDir::symlinkFile to AppDir::createSymlink

* change return value to bool

* Remove duplicated header

* Remove blank lines

* Add comment

* Fix test name

* Change createSymlink signature. Name changed to createRelativeSymlink and remove the useRelativePath argument

* Remove commented tests.
This commit is contained in:
Alexis López Zubieta
2018-11-05 15:10:18 -06:00
committed by TheAssassin
parent 542edaf410
commit d9ca907da8
3 changed files with 22 additions and 0 deletions

View File

@@ -121,6 +121,20 @@ namespace AppDirTest {
ASSERT_TRUE(is_regular_file(destination));
}
TEST_F(AppDirUnitTestsFixture, createSymlink) {
auto destination = tmpAppDir / "usr/share/doc/simple_application/test123";
appDir.deployFile(SIMPLE_FILE_PATH, destination);
appDir.executeDeferredOperations();
ASSERT_TRUE(is_regular_file(destination));
appDir.createRelativeSymlink(destination, tmpAppDir / "relative_link");
auto res = read_symlink(tmpAppDir / "relative_link");
auto expected = relative(destination, tmpAppDir);
ASSERT_TRUE(res == expected);
}
}
int main(int argc, char **argv) {