Skip to content

Commit

Permalink
NSpec.dll now targets .NET 3.5 and as such now allows using Visual St…
Browse files Browse the repository at this point in the history
…udio 2008 for spec projects
  • Loading branch information
mattflo committed Apr 23, 2011
1 parent 5e90eda commit bdb1276
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 87 deletions.
30 changes: 15 additions & 15 deletions NSpec/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public static IEnumerable<T> EachConsecutive2<T>(this IEnumerable<T> source, Act
/// <summary>
/// Action(T, U) will get executed for each item in the list. You can use this to specify a suite of data that needs to be execute across a common set of examples.
/// </summary>
public static void Do<T, U>(this Tuples<T, U> source, Action<T, U> action)
{
foreach (var tup in source)
action(tup.Item1, tup.Item2);
}
//public static void Do<T, U>(this Tuples<T, U> source, Action<T, U> action)
//{
// foreach (var tup in source)
// action(tup.Item1, tup.Item2);
//}

/// <summary>
/// Action(T, U) will get executed for each item in the list. You can use this to specify a suite of data that needs to be execute across a common set of examples.
Expand All @@ -68,20 +68,20 @@ public static void Do<T, U>(this Dictionary<T, U> source, Action<T, U> action)
/// <summary>
/// Action(T, U, V) will get executed for each item in the list. You can use this to specify a suite of data that needs to be execute across a common set of examples.
/// </summary>
public static void Do<T, U, V>(this Tuples<T, U, V> source, Action<T, U, V> action)
{
foreach (var tup in source)
action(tup.Item1, tup.Item2, tup.Item3);
}
//public static void Do<T, U, V>(this Tuples<T, U, V> source, Action<T, U, V> action)
//{
// foreach (var tup in source)
// action(tup.Item1, tup.Item2, tup.Item3);
//}

/// <summary>
/// Action(T, U, V, W) will get executed for each item in the list. You can use this to specify a suite of data that needs to be execute across a common set of examples.
/// </summary>
public static void Do<T, U, V, W>(this Tuples<T, U, V, W> source, Action<T, U, V, W> action)
{
foreach (var tup in source)
action(tup.Item1, tup.Item2, tup.Item3, tup.Item4);
}
//public static void Do<T, U, V, W>(this Tuples<T, U, V, W> source, Action<T, U, V, W> action)
//{
// foreach (var tup in source)
// action(tup.Item1, tup.Item2, tup.Item3, tup.Item4);
//}

/// <summary>
/// Action will be executed n number of times.
Expand Down
4 changes: 2 additions & 2 deletions NSpec/NSpec.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NSpec</RootNamespace>
<AssemblyName>NSpec</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -39,7 +40,6 @@
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions NSpec/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.28")]
[assembly: AssemblyFileVersion("0.9.28")]
[assembly: AssemblyVersion("0.9.29")]
[assembly: AssemblyFileVersion("0.9.29")]
66 changes: 33 additions & 33 deletions NSpec/Tuples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@

namespace NSpec
{
/// <summary>
/// This is a way for you to specify a collection of test data that needs to be asserted over a common set of examples. New one of these up inline and tack on the .Do extension method for some
/// powerful ways to execute examples across the collection. For more information, visit http://www.nspedriven.net.
/// </summary>
public class Tuples<T, U> : List<Tuple<T,U>>
{
public void Add(T t, U u)
{
base.Add(new Tuple<T,U>(t,u));
}
}
///// <summary>
///// This is a way for you to specify a collection of test data that needs to be asserted over a common set of examples. New one of these up inline and tack on the .Do extension method for some
///// powerful ways to execute examples across the collection. For more information, visit http://www.nspedriven.net.
///// </summary>
//public class Tuples<T, U> : List<Tuple<T,U>>
//{
// public void Add(T t, U u)
// {
// base.Add(new Tuple<T,U>(t,u));
// }
//}

/// <summary>
/// This is a way for you to specify a collection of test data that needs to be asserted over a common set of examples. New one of these up inline and tack on the .Do extension method for some
/// powerful ways to execute examples across the collection. For more information, visit http://www.nspedriven.net.
/// </summary>
public class Tuples<T, U, V> : List<Tuple<T, U, V>>
{
public void Add(T t, U u, V v)
{
base.Add(new Tuple<T, U, V>(t, u, v));
}
}
///// <summary>
///// This is a way for you to specify a collection of test data that needs to be asserted over a common set of examples. New one of these up inline and tack on the .Do extension method for some
///// powerful ways to execute examples across the collection. For more information, visit http://www.nspedriven.net.
///// </summary>
//public class Tuples<T, U, V> : List<Tuple<T, U, V>>
//{
// public void Add(T t, U u, V v)
// {
// base.Add(new Tuple<T, U, V>(t, u, v));
// }
//}

/// <summary>
/// This is a way for you to specify a collection of test data that needs to be asserted over a common set of examples. New one of these up inline and tack on the .Do extension method for some
/// powerful ways to execute examples across the collection. For more information, visit http://www.nspedriven.net.
/// </summary>
public class Tuples<T, U, V, W> : List<Tuple<T, U, V, W>>
{
public void Add(T t, U u, V v, W w)
{
base.Add(new Tuple<T, U, V, W>(t, u, v, w));
}
}
///// <summary>
///// This is a way for you to specify a collection of test data that needs to be asserted over a common set of examples. New one of these up inline and tack on the .Do extension method for some
///// powerful ways to execute examples across the collection. For more information, visit http://www.nspedriven.net.
///// </summary>
//public class Tuples<T, U, V, W> : List<Tuple<T, U, V, W>>
//{
// public void Add(T t, U u, V v, W w)
// {
// base.Add(new Tuple<T, U, V, W>(t, u, v, w));
// }
//}
}
4 changes: 2 additions & 2 deletions NSpecRunner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.28")]
[assembly: AssemblyFileVersion("0.9.28")]
[assembly: AssemblyVersion("0.9.29")]
[assembly: AssemblyFileVersion("0.9.29")]
4 changes: 2 additions & 2 deletions NSpecSpecs/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.28")]
[assembly: AssemblyFileVersion("0.9.28")]
[assembly: AssemblyVersion("0.9.29")]
[assembly: AssemblyFileVersion("0.9.29")]
4 changes: 2 additions & 2 deletions NSpecVSExtension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.28")]
[assembly: AssemblyFileVersion("0.9.28")]
[assembly: AssemblyVersion("0.9.29")]
[assembly: AssemblyFileVersion("0.9.29")]
3 changes: 2 additions & 1 deletion RakeFile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ end
task :commit => :pull do
`git add -A .`
`git commit -m "#{ENV['m']}`
`git tag -a v#{get_version_node.text} -m "#{get_version_node.text}"`
`git tag -a v#{get_version_node.text} -m "#{get_version_node.text}" HEAD`
`git push --tags`
end

desc 'supply commit message as parameter - rake all m="commit message" - version bump, nuget, zip and everything shall be done for you'
task :all => [:pull,:version,:nuget,:commit,:website,:zip,:upload]

task :zip do
Expand Down
46 changes: 23 additions & 23 deletions SampleSpecs/Demo/describe_car.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,29 @@ void describe_compression_ratio()
{
Car car = null;

new Tuples<int, int, double>
{
{ 7, 87, .28 },
{ 8, 92, .30 },
{ 9, 96, .32 }
}.Do(
(compressionRatio, octane, effeciency) =>
{
context["car has compression ratio of {0} to 1".With(compressionRatio)] = () =>
{
before = () => car = new Car(compressionRatio);

it["should have octane requirement of {0}".With(octane)] = () =>
{
car.OctaneRequirement.should_be(octane);
};

it["should have brake thermal efficiency of {0}%".With(effeciency * 100)] = () =>
{
car.BrakeThermalEffeciency.should_be(effeciency);
};
};
});
//new Tuples<int, int, double>
//{
// { 7, 87, .28 },
// { 8, 92, .30 },
// { 9, 96, .32 }
//}.Do(
//(compressionRatio, octane, effeciency) =>
//{
// context["car has compression ratio of {0} to 1".With(compressionRatio)] = () =>
// {
// before = () => car = new Car(compressionRatio);

// it["should have octane requirement of {0}".With(octane)] = () =>
// {
// car.OctaneRequirement.should_be(octane);
// };

// it["should have brake thermal efficiency of {0}%".With(effeciency * 100)] = () =>
// {
// car.BrakeThermalEffeciency.should_be(effeciency);
// };
// };
//});
}

void when_driving_car()
Expand Down
2 changes: 1 addition & 1 deletion SampleSpecs/Demo/prime_kata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void prime_factors()
//throwing an unhandled exception should now not cause the runner to crash
//var dict = new Dictionary<int, string> { { 1, "1" }, { 1, "sdfg" } };

new Tuples<int, int[]>
new Dictionary<int, int[]>
{
{ 1, new int[]{}},
{ 2, new[]{ 2 }},
Expand Down
7 changes: 4 additions & 3 deletions SampleSpecs/WebSite/describe_PrimeFactors.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using NSpec;
using System.Collections.Generic;
using NSpec;

class describe_PrimeFactors : nspec
{
void when_determining_prime_factors()
{
new Tuples<int, int[]>
{
new Dictionary<int,int[]>
{
{ 0, new int[] { } },
{ 1, new int[] { } },
{ 2, new[] { 2 } },
Expand Down
2 changes: 1 addition & 1 deletion nspec.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>nspec</id>
<version>0.9.28</version>
<version>0.9.29</version>
<iconUrl>http://nspec.org/themes/contoso/content/images/logo.png</iconUrl>
<licenseUrl>https://github.com/mattflo/NSpec/blob/master/license.txt</licenseUrl>
<authors>Matt Florence, Amir Rajan</authors>
Expand Down

0 comments on commit bdb1276

Please sign in to comment.