Skip to content

Commit

Permalink
Gherkin to 1.4 - Small Breaking Change (#92)
Browse files Browse the repository at this point in the history
* upgrade gherkin to 1.4

since [this
commit](cabbage-ex/gherkin@1cf8f73)
in gherkin, the data tables are provided in the right format, so no need
to convert them.

* remove unused code

* change requirements

gherkin 1.4 does not support 1.1 anymore
  • Loading branch information
leifg authored and meadsteve committed Sep 7, 2017
1 parent 9286bde commit 93ed4fa
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 88 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
language: elixir

otp_release:
- 17.5
- 18.0
- 19.2
- 19.3
- 20.0

elixir:
- 1.1
- 1.2
- 1.3
- 1.4
- 1.5

matrix:
exclude:
Expand All @@ -19,10 +19,10 @@ matrix:
elixir: 1.3
- otp_release: 17.5
elixir: 1.4
- otp_release: 19.2
elixir: 1.1
allow_failures:
- elixir: 1.4 # There are deprecation warnings that need to be fixed.
- otp_release: 20.0
elixir: 1.2
- otp_release: 20.0
elixir: 1.3

script:
- mix local.hex --force
Expand Down
6 changes: 1 addition & 5 deletions features/contexts/default_context.exs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ defmodule WhiteBread.Example.DefaultContext.LoafContext do
end

defmodule WhiteBread.Example.DefaultContext.TableStuff do
import WhiteBread.Helpers

def load_table(_state, %{table_data: raw_table_data}) do
table_data = raw_table_data |> index_table_by_first_row

def load_table(_state, %{table_data: table_data}) do
[%{'Person': first_god}, %{'Person': second_god} | _extra_rows] = table_data
{:ok, {first_god, second_god}}
end
Expand Down
7 changes: 0 additions & 7 deletions lib/white_bread/helpers.ex

This file was deleted.

1 change: 0 additions & 1 deletion lib/white_bread/runners/scenario_outline_runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ defmodule WhiteBread.Runners.ScenarioOutlineRunner do

defp build_each_example(outline) do
outline.examples
|> WhiteBread.Tables.index_table_by_first_row
|> Enum.map(&create_steps(&1, outline.steps))
end

Expand Down
36 changes: 0 additions & 36 deletions lib/white_bread/tables.ex

This file was deleted.

4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule WhiteBread.Mixfile do
links: %{"GitHub" => "https://github.com/meadsteve/white-bread"},
],
version: "3.1.0",
elixir: "~> 1.1",
elixir: "~> 1.2",
aliases: aliases(),
deps: deps()]
end
Expand Down Expand Up @@ -55,7 +55,7 @@ defmodule WhiteBread.Mixfile do
# Type `mix help deps` for more examples and options
defp deps do
[
{:gherkin, "< 1.2.0"},
{:gherkin, "~> 1.4"},

{:credo, "~> 0.8", only: :dev},
{:earmark, "~> 1.2", only: :dev},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"credo": {:hex, :credo, "0.8.6", "335f723772d35da499b5ebfdaf6b426bfb73590b6fcbc8908d476b75f8cbca3f", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}], "hexpm"},
"earmark": {:hex, :earmark, "1.2.3", "206eb2e2ac1a794aa5256f3982de7a76bf4579ff91cb28d0e17ea2c9491e46a4", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.16.3", "cd2a4cfe5d26e37502d3ec776702c72efa1adfa24ed9ce723bb565f4c30bd31a", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
"gherkin": {:hex, :gherkin, "1.1.0", "55a8ed26293c9a97fb9f7c792b566a4c0b980a9ecbe5fe5f226939f5b3967127", [:mix], [], "hexpm"}}
"gherkin": {:hex, :gherkin, "1.4.0", "b7b6a80029725a4b29a1c58f96ddb3fa9409d4fa907503384b1f86392491fcd0", [:mix], [], "hexpm"}}
12 changes: 6 additions & 6 deletions test/runners/scenario_outline_runner_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ defmodule WhiteBread.Runners.ScenarioOutlineRunnerTest do
%Steps.When{text: "step <number_two>"}
]
examples = [
["number_one", "number_two"],
["one", "one"],
["one", "two"]
%{number_one: "one", number_two: "one"},
%{number_one: "one", number_two: "two"},
]

scenario_outline = %ScenarioOutline{name: "test scenario", steps: steps, examples: examples}

expected_two_successes = [
Expand All @@ -31,10 +31,10 @@ defmodule WhiteBread.Runners.ScenarioOutlineRunnerTest do
%Steps.When{text: "step <number_two>"}
]
examples = [
["number_one", "number_two"],
["one", "two"],
["two", "one"]
%{number_one: "one", number_two: "two"},
%{number_one: "two", number_two: "one"},
]

scenario_outline = %ScenarioOutline{name: "test scenario", steps: steps, examples: examples}

[{:ok, "test scenario"}, {expected_result, _failure_data}
Expand Down
23 changes: 0 additions & 23 deletions test/tables_test.exs

This file was deleted.

0 comments on commit 93ed4fa

Please sign in to comment.