Skip to content

Commit

Permalink
#15: change logic for skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
christianspecht committed Apr 3, 2019
1 parent d4a5df8 commit e59986c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
14 changes: 2 additions & 12 deletions src/ScmBackup.Tests.Integration/Hosters/GithubBackupTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,9 @@ public class GithubBackupTests : IBackupTests
internal override string PrivateUserName { get { return TestHelper.EnvVar("Github_Name"); } }
internal override string PrivateRepoName { get { return TestHelper.EnvVar("Github_RepoPrivate"); } }

internal override HashSet<string> TestsToSkip
protected override bool SkipTestsIssue15()
{
get
{
var t = new HashSet<string>();

if (TestHelper.RunsOnAppVeyor())
{
// t.Add("DoesntBackupWikiIfNotSet");
}

return t;
}
return TestHelper.RunsOnAppVeyor();
}

protected override void Setup(bool usePrivateRepo)
Expand Down
10 changes: 7 additions & 3 deletions src/ScmBackup.Tests.Integration/Hosters/IBackupTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ protected virtual void AssertIssues(string dir) { }
internal virtual string PrivateRepoName { get { return null; } }
protected virtual void AssertPrivateRepo(string dir) { }

// The child classes need to implement this, if they need to skip some tests
internal virtual HashSet<string> TestsToSkip { get { return new HashSet<string>(); } }
// skip certain tests because of https://github.com/christianspecht/scm-backup/issues/15
// Child classes which need to skip those tests need to implement this and return true
protected virtual bool SkipTestsIssue15()
{
return false;
}

[Fact]
public void MakesBackup()
Expand Down Expand Up @@ -71,7 +75,7 @@ public void MakesBackupOfPrivateRepo()
[SkippableFact]
public void DoesntBackupWikiIfNotSet()
{
Skip.If(this.TestsToSkip.Contains("DoesntBackupWikiIfNotSet"));
Skip.If(this.SkipTestsIssue15());

var dir = DirectoryHelper.CreateTempDirectory(this.DirSuffix("doesnt-backup-wiki"));
this.Setup(false);
Expand Down

0 comments on commit e59986c

Please sign in to comment.