Skip to content

Commit

Permalink
integration test when framework is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
smoothdeveloper committed May 3, 2016
1 parent e939078 commit fed823d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module Paket.IntegrationTests.LoadingScriptGenerationTests
open System
open System.IO
open NUnit.Framework
open Paket.IntegrationTests.TestHelpers
open System.IO
open Paket

let makeScenarioPath scenario = Path.Combine("loading-scripts-scenarios", scenario)
Expand All @@ -22,7 +23,6 @@ let ``simple dependencies generates expected scripts``() =
let framework = "net4"
paket "install" scenario |> ignore


directPaket (sprintf "generate-include-scripts framework %s" framework) scenario |> ignore

let files = getGeneratedScriptFiles framework scenario
Expand All @@ -37,3 +37,37 @@ let ``simple dependencies generates expected scripts``() =
|]
Assert.AreEqual(expectedFiles, actualFiles)


[<Test>]
let ``framework specified``() =
let scenario = "framework-specified"
paket "install" scenario |> ignore

directPaket "generate-include-scripts" scenario |> ignore

let files =
getGeneratedScriptFiles "net35" scenario
|> Seq.map (fun f -> f.Name, f)
|> dict

let expectations = [
"include.iesi.collections.csx", ["Net35/Iesi.Collections.dll"]
"include.iesi.collections.fsx", ["Net35/Iesi.Collections.dll"]
"include.nhibernate.csx", ["Net35/NHibernate.dll";"#load \"include.iesi.collections.csx\""]
"include.nhibernate.fsx", ["Net35/NHibernate.dll";"#load @\"include.iesi.collections.fsx\""]
]

let failures = seq {
for (file, contains) in expectations do
match files.TryGetValue file with
| false, _ -> yield sprintf "file %s was not found" file
| true, file ->
let text = file.FullName |> File.ReadAllText
for expectedText in contains do
if not (text.Contains expectedText) then
yield sprintf "file %s didn't contain %s" file.FullName expectedText
}

if not (Seq.isEmpty failures) then
Assert.Fail (failures |> String.concat Environment.NewLine)

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source http://nuget.org/api/v2
framework: net35

nuget NHibernate ~> 3

0 comments on commit fed823d

Please sign in to comment.