Skip to content

Commit

Permalink
Merge pull request #7 from nelsonwellswku/issue-6
Browse files Browse the repository at this point in the history
Issue 6: Update to 0.15.2 of Cake;
  • Loading branch information
gep13 authored Oct 13, 2016
2 parents 47d16be + 6163d66 commit 1e94119
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 35 deletions.
5 changes: 2 additions & 3 deletions src/Cake.AliaSql.Tests/AliaSqlFixture.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.ComponentModel.Design;
using Cake.Common.Tests.Fixtures;
using Cake.Common.Tests.Fixtures;
using Cake.Testing;

namespace Cake.AliaSql.Tests
Expand All @@ -8,7 +7,7 @@ public sealed class AliaSqlFixture : ToolFixture<AliaSqlSettings>
{
protected override void RunTool()
{
var tool =new AliaSqlRunner(FileSystem, Environment, Globber, ProcessRunner);
var tool = new AliaSqlRunner(FileSystem, Environment, ProcessRunner, ToolLocator);
tool.Run(Settings);
}

Expand Down
4 changes: 1 addition & 3 deletions src/Cake.AliaSql.Tests/AliaSqlRunnerTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Diagnostics;
using Cake.Core;
using Cake.Core.IO;
using NSubstitute;
using Xunit;
using Xunit.Extensions;

namespace Cake.AliaSql.Tests
{
Expand Down Expand Up @@ -102,7 +100,7 @@ public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
var result = Record.Exception(() => fixture.Run());

// Then
Assert.Equal("AliaSql: Process returned an error.", result.Message);
Assert.Equal("AliaSql: Process returned an error (exit code 1).", result.Message);
Assert.IsType<CakeException>(result);
}

Expand Down
12 changes: 6 additions & 6 deletions src/Cake.AliaSql.Tests/Cake.AliaSql.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cake.Core, Version=0.6.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Core.0.6.4\lib\net45\Cake.Core.dll</HintPath>
<Reference Include="Cake.Core, Version=0.15.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Core.0.15.2\lib\net45\Cake.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Cake.Testing, Version=0.6.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Testing.0.6.4\lib\net45\Cake.Testing.dll</HintPath>
<Reference Include="Cake.Testing, Version=0.15.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Testing.0.15.2\lib\net45\Cake.Testing.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NSubstitute, Version=1.9.2.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.1.9.2.0\lib\net45\NSubstitute.dll</HintPath>
<Reference Include="NSubstitute, Version=1.10.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
6 changes: 6 additions & 0 deletions src/Cake.AliaSql.Tests/ToolFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public abstract class ToolFixture<TToolSettings, TFixtureResult>
public FakeEnvironment Environment { get; set; }
public IGlobber Globber { get; set; }
public TToolSettings Settings { get; set; }
public IToolLocator ToolLocator { get; set; }

protected ToolFixture(string toolFilename)
{
Expand All @@ -47,6 +48,11 @@ protected ToolFixture(string toolFilename)
Environment = FakeEnvironment.CreateUnixEnvironment();
FileSystem = new FakeFileSystem(Environment);
Globber = new Globber(FileSystem, Environment);
ToolLocator = new ToolLocator(
Environment,
new ToolRepository(Environment),
new ToolResolutionStrategy(FileSystem, Environment, Globber, new FakeConfiguration())
);

// Create the default tool path.
FileSystem.CreateFile(GetDefaultToolPath());
Expand Down
6 changes: 3 additions & 3 deletions src/Cake.AliaSql.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake.Core" version="0.6.4" targetFramework="net45" />
<package id="Cake.Testing" version="0.6.4" targetFramework="net45" />
<package id="NSubstitute" version="1.9.2.0" targetFramework="net45" />
<package id="Cake.Core" version="0.15.2" targetFramework="net45" />
<package id="Cake.Testing" version="0.15.2" targetFramework="net45" />
<package id="NSubstitute" version="1.10.0.0" targetFramework="net45" />
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
Expand Down
8 changes: 4 additions & 4 deletions src/Cake.AliaSql/AliaSqlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public static void AliaSql(this ICakeContext context, AliaSqlSettings settings)
throw new ArgumentNullException("settings");
}

var runner = new AliaSqlRunner(context.FileSystem, context.Environment, context.Globber,
context.ProcessRunner);
var runner = new AliaSqlRunner(context.FileSystem, context.Environment, context.ProcessRunner,
context.Tools);

runner.Run(settings);
}
Expand All @@ -99,8 +99,8 @@ public static void AliaSql(this ICakeContext context, string command, AliaSqlSet

settings.Command = command;

var runner = new AliaSqlRunner(context.FileSystem, context.Environment, context.Globber,
context.ProcessRunner);
var runner = new AliaSqlRunner(context.FileSystem, context.Environment, context.ProcessRunner,
context.Tools);

runner.Run(settings);
}
Expand Down
25 changes: 12 additions & 13 deletions src/Cake.AliaSql/AliaSqlRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@ public sealed class AliaSqlRunner : Tool<AliaSqlSettings>
{
private readonly IFileSystem _fileSystem;

/// <summary>
/// Initializes a new instance of the <see cref="AliaSqlRunner"/> class.
/// </summary>
/// <param name="fileSystem"></param>
/// <param name="environment"></param>
/// <param name="globber"></param>
/// <param name="processRunner"></param>
public AliaSqlRunner(IFileSystem fileSystem, ICakeEnvironment environment,
IGlobber globber, IProcessRunner processRunner)
: base(fileSystem, environment, processRunner, globber)
{
_fileSystem = fileSystem;
}
/// <summary>
/// Initializes a new instance of the <see cref="AliaSqlRunner"/> class.
/// </summary>
/// <param name="fileSystem"></param>
/// <param name="environment"></param>
/// <param name="processRunner"></param>
/// <param name="tools"></param>
public AliaSqlRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools)
: base(fileSystem, environment, processRunner, tools)
{
_fileSystem = fileSystem;
}

/// <summary>
/// Runs AliaSql with the provided settings.
Expand Down
4 changes: 2 additions & 2 deletions src/Cake.AliaSql/Cake.AliaSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cake.Core, Version=0.6.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Core.0.6.4\lib\net45\Cake.Core.dll</HintPath>
<Reference Include="Cake.Core, Version=0.15.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Core.0.15.2\lib\net45\Cake.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.AliaSql/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake.Core" version="0.6.4" targetFramework="net45" />
<package id="Cake.Core" version="0.15.2" targetFramework="net45" />
</packages>

0 comments on commit 1e94119

Please sign in to comment.