corbym / gogiven

gogiven - BDD testing framework for go that generates readable output directly from source code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Given/When/Then inlined variables

corbym opened this issue · comments

commented

As a developer, I want to be able to inline variables I pass to my functions in a formatted way, so that my tests are more understandable.

Example:

func TestMyStuff(testing testing.T){
    Given(iAmMaking_CupsOf_Tea(3, "Earl Grey")).
         When(iPour_MillilitersOfWater("250")).
         Then(func(...){
         // some assertions
         }

}

.. should render as:

Given I am making 3 cups of Earl Grey Tea
When I pour 250 milliliters of water
Then
    // some assertions