Few days ago Pawel Lesnikowski has blogged about his Live Templates for ReSharper. Because I think it is good idea to share such things with other developers I decided to show my Live Templates I have made to be able to create BDD specifications with MSpec faster. Here they are:
specc – Short template for MSpec BDD context
public abstract class with_$Context$
{
Establish context = () =>
{
$END$
};
}
specf – Full template for MSpec BDD specification
[Subject(typeof($Subject$))]
public class when_$Specification$
{
Establish context = () =>
{
};
Because of = () =>
{
};
It should_$Behaviour$;$END$
}
specs – Short template for MSpec BDD specification
[Subject(typeof($Subject$))]
public class when_$Specification$
{
It should_$Behaviour$;$END$
}
spect – Default template for MSpec BDD specification
[Subject(typeof($Subject$))]
public class when_$Specification$ : with_$Context$
{
Because of = () =>
{
};
It should_$Behaviour$;$END$
}
Here you can download definition of all mentioned templates which can be imported to your ReSharper: MSpec.LiveTemplates
Are you using MSpec in ByteCarrot? Is it worth a try?
Yes, it is worth a try because way of working with it is quite different comparing to standard TDD with NUnit. Additionally it has few unique features like possibility to create specifications without theirs implementation or report generation.
No, I am not using it in ByteCarrot (yet?). MSpec currently requires a lot of configuration to be able to use it in a project and integration with tools with ReSharper’s test runner or TestDriven.NET is poor. In ByteCarrot I have my own little BDD framework (few classes) similar to SpecUnit.NET based on NUnit.