/gherkin

A Gherkin file parser written in Elixir. Extracted from https://github.com/meadsteve/white-bread.

Primary LanguageElixir

Gherkin Hex.pm

Coverage Status CircleCI

A Gherkin file parser written in Elixir. Parses .feature files and translates them to native Elixir terms for processing.

Extracted from https://github.com/meadsteve/white-bread

Installation

The package can be installed as:

  1. Add gherkin to your list of dependencies in mix.exs:
def deps do
  [{:gherkin, "~> 1.0"}]
end
  1. Ensure gherkin is started before your application:
def application do
  [applications: [:gherkin]]
end

Example Usage

%Gherkin.Elements.Feature{scenarios: scenarios} = File.read!("test/features/coffee.feature") |> Gherkin.parse()
# Do something with `scenarios`

# Also supports file streams for larger files (must read by lines, bytes not supported)
%Gherkin.Elements.Feature{scenarios: scenarios} = File.stream!("test/features/coffee.feature") |> Gherkin.parse()