Skip to content

Overview: Developer's Perspective

JamesMaroney edited this page Jun 21, 2012 · 1 revision

Similar to the Gherkin-based tools for BDD testing, How2 maps statements to executable code via regex matching. The intention is that teams accustomed to working with Cucumber, SpecFlow, etc. will feel right at home using How2.

How2 aims to provide the capability to load step runners written in many different languages so that you have the flexibility to implement any given step with the most appropriate tools.

Proposed Syntax for Step Definitions

Ruby

How2 /some (.*) regex/ do |middle|
  ...
end

C#

[How2(@"some (.*) regex")]
public void someStep(string middle){
  ...
}

Coffeescript

how2 /some (.*) regex/, (middle)->
  ...

Specifying Manual Steps

Some steps are just best done by humans, others just take some extra time to automate. How2 automatically considers unmapped statements as needing manual intervention. You can also programatically specify a step as needing a human's touch with the manual method, which takes an optional string parameter to be provided to the user as a note.

Ruby

How2 /something/ do
  @manual 'some notes';
end

C#

public class Steps extends How2Steps{
  [How2(@"something")]
  public void Something(){
    @manual('some notes');
  }
}

Coffeescript

how2 /something/, ->
  @manual 'some notes'

Clone this wiki locally