Skip to content

dohernandez/boostrap-feature-tests

Repository files navigation

boostrap-feature-tests

Build Status GoDevDoc Code lines Comments

This library helps to define a suite test for github.com/cucumber/godog.

Usage

Feature

# features/test.feature
Feature: Test boostrap feature run.

  Scenario: Test boostrap feature run
    When I boostrap feature
    Then I should have run

Configuration

Register the context, set the folder with the feature files to run the suite.

cnt := int64(0)

feature.RunFeatures(t, "features", func(_ *testing.T, s *godog.ScenarioContext) {
    s.Step(`^I boostrap feature$`, func() error {
        atomic.AddInt64(&cnt, 1)

        return nil
    })

    s.Step(`^I should have run$`, func() error {
        assert.Equal(t, int64(1), atomic.LoadInt64(&cnt))

        return nil
    })
})