Skip to content

Commit

Permalink
make tests debuggable again - add missing ensureDir()
Browse files Browse the repository at this point in the history
  • Loading branch information
0x53A committed Apr 11, 2017
1 parent 924258a commit 45cefaf
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/Paket.Tests/InstallModel/Xml/EmptyLibs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let expected = """

[<Test>]
let ``should generate Xml for framework references and empty libs``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "TempPkg", SemVer.Parse "0.1", [],
[ ],
Expand Down
5 changes: 5 additions & 0 deletions tests/Paket.Tests/InstallModel/Xml/Fantomas.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let expected = """

[<Test>]
let ``should generate Xml for Fantomas 1.5``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "Fantomas", SemVer.Parse "1.5.0", [],
[ @"..\Fantomas\lib\FantomasLib.dll"
Expand Down Expand Up @@ -55,6 +56,7 @@ let fullDoc = """<?xml version="1.0" encoding="utf-8"?>

[<Test>]
let ``should generate full Xml for Fantomas 1.5``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "Fantomas", SemVer.Parse "1.5.0", [],
[ @"..\Fantomas\lib\FantomasLib.dll"
Expand All @@ -76,6 +78,7 @@ let ``should generate full Xml for Fantomas 1.5``() =

[<Test>]
let ``should not generate full Xml for Fantomas 1.5 if not referenced``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "Fantomas", SemVer.Parse "1.5.0", [],
[ @"..\Fantomas\lib\FantomasLib.dll"
Expand Down Expand Up @@ -112,6 +115,7 @@ let fullDocWithRefernceCondition = """<?xml version="1.0" encoding="utf-8"?>

[<Test>]
let ``should generate full Xml with reference condition for Fantomas 1.5``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "Fantomas", SemVer.Parse "1.5.0", [],
[ @"..\Fantomas\lib\FantomasLib.dll"
Expand Down Expand Up @@ -153,6 +157,7 @@ let fullDocWithRefernceConditionAndFrameworkRestriction = """<?xml version="1.0"
let ``should generate full Xml with reference condition and framework restrictions without msbuild warning``() =
// msbuild triggers a warning MSB4130 when we leave out the quotes around $(LEGACY) and add the condition at the end
// It seems like the warning is triggered when there is an "Or" without parentheses somewhere
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "Fantomas", SemVer.Parse "1.5.0",
[ FrameworkRestriction.Exactly (FrameworkIdentifier.XamariniOS)
Expand Down
1 change: 1 addition & 0 deletions tests/Paket.Tests/InstallModel/Xml/FantomasLib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let expected = """

[<Test>]
let ``should generate Xml for Fantomas 1.5``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "Fantomas", SemVer.Parse "1.5.0", [],
[ @"..\Fantomas\Lib\FantomasLib.dll"
Expand Down
1 change: 1 addition & 0 deletions tests/Paket.Tests/InstallModel/Xml/GitInfoPlanter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let expectedPropertyNodes = """<?xml version="1.0" encoding="utf-16"?>

[<Test>]
let ``should generate Xml for GitInfoPlanter2.0.0``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "GitInfoPlanter", SemVer.Parse "0.21", [],
[ ],
Expand Down
2 changes: 2 additions & 0 deletions tests/Paket.Tests/InstallModel/Xml/Microsoft.Bcl.Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ open Paket
open NUnit.Framework
open FsUnit
open Paket.Domain
open Paket.TestHelpers

[<Test>]
let ``should not install targets node for Microsoft.Bcl.Build``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "Microsoft.Bcl.Build", SemVer.Parse "1.0.21", [],
[ ],
Expand Down
1 change: 1 addition & 0 deletions tests/Paket.Tests/InstallModel/Xml/RemovesOldNodes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ open Paket.Requirements

[<Test>]
let ``should generate Xml for Fuchu 0.4``() =
ensureDir()
let p = ProjectFile.TryLoad("./ProjectFile/TestData/EmptyWithOldStuff.fsprojtest").Value
let empty = ProjectFile.TryLoad("./ProjectFile/TestData/Empty.fsprojtest").Value
p.RemovePaketNodes()
Expand Down
1 change: 1 addition & 0 deletions tests/Paket.Tests/InstallModel/Xml/StyleCop.MSBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let expectedPropertyNodes = """<?xml version="1.0" encoding="utf-16"?>

[<Test>]
let ``should generate Xml for StyleCop.MSBuild``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "StyleCop.MSBuild", SemVer.Parse "4.7.49.1", [],[],
[ @"..\StyleCop.MSBuild\build\StyleCop.MSBuild.Targets" ],
Expand Down
1 change: 1 addition & 0 deletions tests/Paket.Tests/InstallModel/Xml/SystemNetHttpForNet4.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let expected = """

[<Test>]
let ``should generate Xml for System.Net.Http 2.2.8``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "System.Net.Http", SemVer.Parse "2.2.8", [FrameworkRestriction.Exactly(DotNetFramework(FrameworkVersion.V4))],
[ @"..\Microsoft.Net.Http\lib\monoandroid\System.Net.Http.Extensions.dll"
Expand Down
1 change: 1 addition & 0 deletions tests/Paket.Tests/InstallModel/Xml/xunit.runner.fs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ let disabledChooseNode = """<?xml version="1.0" encoding="utf-16"?>

[<Test>]
let ``should not generate Xml for xunit.runner.visualstudio 2.0.0 if import is disabled``() =
ensureDir()
let model =
InstallModel.CreateFromLibs(PackageName "xunit.runner.visualstudio", SemVer.Parse "2.50.0", [],[],
[ @"..\xunit.runner.visualstudio\build\net20\xunit.runner.visualstudio.props"
Expand Down
2 changes: 2 additions & 0 deletions tests/Paket.Tests/ProjectFile/TargetFrameworkSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
open Paket
open NUnit.Framework
open FsUnit
open Paket.TestHelpers

let TestData: obj[][] =
[|
Expand Down Expand Up @@ -31,6 +32,7 @@ let TestData: obj[][] =
[<Test>]
[<TestCaseSource("TestData")>]
let ``should detect the correct framework on test projects`` projectFile expectedProfile expectedProfileString expectedTargetFramework =
ensureDir()
let p = ProjectFile.TryLoad("./ProjectFile/TestData/" + projectFile).Value
p.GetTargetProfile() |> shouldEqual expectedProfile
p.GetTargetProfile().ToString() |> shouldEqual expectedProfileString
Expand Down

0 comments on commit 45cefaf

Please sign in to comment.