Skip to content

Commit

Permalink
create regression test for #1135
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Oct 30, 2015
1 parent d8e7167 commit f00a786
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
17 changes: 17 additions & 0 deletions integrationtests/Paket.IntegrationTests/InstallSpecs.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Paket.IntegrationTests.InstallSpecs

open Fake
open System
open NUnit.Framework
open FsUnit
open System
open System.IO
open System.Diagnostics
open Paket

[<Test>]
let ``#1135 should keep lockfile stable when using framework restrictions``() =
let newLockFile = install "i001135-stable-install-on-framework-restrictions"
let oldLockFile = LockFile.LoadFrom(Path.Combine(originalScenarioPath "i001135-stable-install-on-framework-restrictions","paket.lock"))
newLockFile.ToString()
|> shouldEqual (oldLockFile.ToString())
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<Compile Include="InitSpecs.fs" />
<Compile Include="AddSpecs.fs" />
<Compile Include="OutdatedSpecs.fs" />
<Compile Include="InstallSpecs.fs" />
<Compile Include="GroupSpecs.fs" />
<Compile Include="FrameworkRestrictionsSpecs.fs" />
<Compile Include="BasicResolverSpecs.fs" />
Expand Down
7 changes: 6 additions & 1 deletion integrationtests/Paket.IntegrationTests/TestHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ open System.IO
let paketToolPath = FullName(__SOURCE_DIRECTORY__ + "../../../bin/paket.exe")
let integrationTestPath = FullName(__SOURCE_DIRECTORY__ + "../../../integrationtests/scenarios")
let scenarioTempPath scenario = Path.Combine(integrationTestPath,scenario,"temp")
let originalScenarioPath scenario = Path.Combine(integrationTestPath,scenario,"before")

let paket command scenario =
let originalScenarioPath = Path.Combine(integrationTestPath,scenario,"before")
let originalScenarioPath = originalScenarioPath scenario
let scenarioPath = scenarioTempPath scenario
CleanDir scenarioPath
CopyDir scenarioPath originalScenarioPath (fun _ -> true)
Expand All @@ -34,6 +35,10 @@ let update scenario =
paket "update" scenario |> ignore
LockFile.LoadFrom(Path.Combine(scenarioTempPath scenario,"paket.lock"))

let install scenario =
paket "install" scenario |> ignore
LockFile.LoadFrom(Path.Combine(scenarioTempPath scenario,"paket.lock"))

let updateShouldFindPackageConflict packageName scenario =
try
update scenario |> ignore
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source https://nuget.org/api/v2

nuget StackExchange.Redis ~> 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
NUGET
remote: https://nuget.org/api/v2
specs:
Microsoft.Bcl (1.1.10) - framework: net40
Microsoft.Bcl.Build (>= 1.0.14)
Microsoft.Bcl.Async (1.0.168) - framework: net40
Microsoft.Bcl (>= 1.1.8)
Microsoft.Bcl.Build (1.0.21) - import_targets: false, framework: net40
StackExchange.Redis (1.0.481)
Microsoft.Bcl (>= 1.1.9)
Microsoft.Bcl.Async (>= 1.0.168)

0 comments on commit f00a786

Please sign in to comment.