Skip to content

Commit

Permalink
"Paket init" Integration tests - references #1040
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Oct 29, 2015
1 parent 73313d0 commit b10ddff
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 6 deletions.
2 changes: 2 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Target "RunTests" (fun _ ->
|> NUnit (fun p ->
{ p with
DisableShadowCopy = true
ToolPath = "packages/test/NUnit.Runners.Net4/tools"
TimeOut = TimeSpan.FromMinutes 20.
OutputFile = "TestResults.xml" })
)
Expand All @@ -170,6 +171,7 @@ Target "RunIntegrationTests" (fun _ ->
|> NUnit (fun p ->
{ p with
DisableShadowCopy = true
ToolPath = "packages/test/NUnit.Runners.Net4/tools"
TimeOut = TimeSpan.FromMinutes 20.
OutputFile = "TestResults.xml" })
)
Expand Down
18 changes: 18 additions & 0 deletions integrationtests/Paket.IntegrationTests/InitSpecs.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Paket.IntegrationTests.InitSpecs

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

[<Test>]
let ``#1040 init should download release version of bootstrapper``() =
paket "init" "i001040-init-downloads-bootstrapper"
let bootstrapperpath = Path.Combine(scenarioTempPath "i001040-init-downloads-bootstrapper",".paket","paket.bootstrapper.exe")

let productVersion = FileVersionInfo.GetVersionInfo(bootstrapperpath).ToString()
String.IsNullOrWhiteSpace productVersion |> shouldEqual false
productVersion.Contains("-") |> shouldEqual false
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
</Compile>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="TestHelper.fs" />
<Compile Include="InitSpecs.fs" />
<Compile Include="ResolverSkipsConflictsFastSpecs.fs" />
<None Include="paket.references" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open System
open System.IO

[<Test>]
let ``#166 Should resolve Nancy without timeount``() =
let ``#1166 Should resolve Nancy without timeount``() =
update "i001166-resolve-nancy-fast"

[<Test>]
Expand Down
3 changes: 2 additions & 1 deletion integrationtests/Paket.IntegrationTests/TestHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ 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 paket command scenario =
let originalScenarioPath = Path.Combine(integrationTestPath,scenario,"before")
let scenarioPath = Path.Combine(integrationTestPath,scenario,"temp")
let scenarioPath = scenarioTempPath scenario
CleanDir scenarioPath
CopyDir scenarioPath originalScenarioPath (fun _ -> true)

Expand Down
Empty file.
4 changes: 2 additions & 2 deletions src/Paket.Core/Environment.fs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ module PaketEnv =

let init (directory : DirectoryInfo) =
match locatePaketRootDirectory directory with
| Some rootDirectory ->
| Some rootDirectory when rootDirectory.FullName = directory.FullName ->
Logging.tracefn "Paket is already initialized in %s" rootDirectory.FullName
ok ()
| None ->
| _ ->
let sources = [PackageSources.DefaultNugetSource]
let serialized =
(sources
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
<StartArguments>update group Build</StartArguments>
<StartArguments>pack output D:\code\paketbug\output</StartArguments>
<StartArguments>install</StartArguments>
<StartArguments>update -f</StartArguments>
<StartArguments>init</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>c:\code\Paketkopie</StartWorkingDirectory>
<StartWorkingDirectory>C:\Temp\paket_test\</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketkopie</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketbug</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketrepro</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\paketbug</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001040-init-downloads-bootstrapper\temp</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit b10ddff

Please sign in to comment.