mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Deleting specflow folders only if they exist
--HG-- branch : dev
This commit is contained in:
@@ -31,7 +31,9 @@ namespace Orchard.Specs.Bindings {
|
|||||||
|
|
||||||
[BeforeTestRun]
|
[BeforeTestRun]
|
||||||
public static void BeforeTestRun() {
|
public static void BeforeTestRun() {
|
||||||
_orchardTemp.Delete(true).CreateDirectory();
|
if ( _orchardTemp.Exists ) {
|
||||||
|
_orchardTemp.Delete(true).CreateDirectory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AfterTestRun]
|
[AfterTestRun]
|
||||||
|
@@ -24,7 +24,12 @@ namespace Orchard.Specs.Hosting {
|
|||||||
public void Initialize(string templateName, string virtualDirectory) {
|
public void Initialize(string templateName, string virtualDirectory) {
|
||||||
var baseDir = Path.Get(AppDomain.CurrentDomain.BaseDirectory);
|
var baseDir = Path.Get(AppDomain.CurrentDomain.BaseDirectory);
|
||||||
|
|
||||||
_tempSite = Path.Get(_orchardTemp).Combine(System.IO.Path.GetRandomFileName()).Delete().CreateDirectory();
|
_tempSite = Path.Get(_orchardTemp).Combine(System.IO.Path.GetRandomFileName());
|
||||||
|
if(_tempSite.Exists) {
|
||||||
|
_tempSite.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
_tempSite.CreateDirectory();
|
||||||
|
|
||||||
// Trying the two known relative paths to the Orchard.Web directory.
|
// Trying the two known relative paths to the Orchard.Web directory.
|
||||||
// The second one is for the target "spec" in orchard.proj.
|
// The second one is for the target "spec" in orchard.proj.
|
||||||
|
Reference in New Issue
Block a user