Skip to content
Browse files

Getting NSpec runner to work with filters using NSpec tags

  • Loading branch information...
1 parent 1177469 commit d4493a01a2e73a32ded06bb4b49a25326cd9eb62 @codereflection committed Apr 1, 2012
Showing with 16 additions and 15 deletions.
  1. +16 −15 src/Runners/Giles.Runner.NSpec/NSpecRunner.cs
View
31 src/Runners/Giles.Runner.NSpec/NSpecRunner.cs
@@ -1,27 +1,28 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System.Collections.Generic;
+using System.Linq;
using Giles.Core.Runners;
-using System.Reflection;
-using NSpec;
+using System.Reflection;
using NSpec.Domain;
namespace Giles.Runner.NSpec
{
public class NSpecRunner : IFrameworkRunner
- {
+ {
public IEnumerable<string> RequiredAssemblies()
{
return new[] { Assembly.GetAssembly(typeof(NSpecRunner)).Location, "NSpec.dll" };
- }
-
- public SessionResults RunAssembly(Assembly assembly)
- {
- var sessionResults = new SessionResults();
- var runner = new RunnerInvocation(assembly.Location, String.Empty, new GilesSessionResultsFormatter(sessionResults), false);
- var runResults = runner.Run();
- return sessionResults;
- }
+ }
+
+ public SessionResults RunAssembly(Assembly assembly, IEnumerable<string> filters)
+ {
+ var sessionResults = new SessionResults();
+ var tags = string.Empty;
+ if (filters.Count() > 0)
+ tags = filters.Aggregate((working, next) => working + "," + next);
+ var runner = new RunnerInvocation(assembly.Location, tags, new GilesSessionResultsFormatter(sessionResults), false);
+ var runResults = runner.Run();
+ return sessionResults;
+ }
}
}

0 comments on commit d4493a0

Please sign in to comment.
Something went wrong with that request. Please try again.