From ef24c9f594cb348193f56c9935179c273b651f97 Mon Sep 17 00:00:00 2001 From: Dmitrii Malinovskii Date: Wed, 19 Jun 2024 21:21:17 +0400 Subject: [PATCH] get language from file name --- internal/app/app.feature | 83 +++++++++++-------- internal/app/app.go | 9 ++ internal/app/app_test.go | 42 ++++++++++ internal/app/{languages.go => language.go} | 14 ++++ internal/app/testdata/english.feature | 7 ++ .../app/testdata/english.sample.en.feature | 7 ++ internal/app/testdata/pirate.feature | 8 ++ .../testdata/pirate.sample.en-pirate.feature | 8 ++ 8 files changed, 145 insertions(+), 33 deletions(-) rename internal/app/{languages.go => language.go} (82%) create mode 100644 internal/app/testdata/english.feature create mode 100644 internal/app/testdata/english.sample.en.feature create mode 100644 internal/app/testdata/pirate.feature create mode 100644 internal/app/testdata/pirate.sample.en-pirate.feature diff --git a/internal/app/app.feature b/internal/app/app.feature index edd0e64..94fc97f 100644 --- a/internal/app/app.feature +++ b/internal/app/app.feature @@ -1,55 +1,56 @@ Feature: Application command line tool + Scenario Outline: User wants to generate the output in given format When is given And is provided Then the output should be generated Examples: - | | | | - | app.feature | go | does | - | app.feature | json | does | - | app.feature | raw | does | - | app.feature | invalid | does not | - | notfound.feature | raw | does not | + | | | | + | app.feature | go | does | + | app.feature | json | does | + | app.feature | raw | does | + | app.feature | invalid | does not | + | notfound.feature | raw | does not | Scenario Outline: User wants to see usage information When is provided Then usage should be printed Examples: - | | - | --help | + | | + | --help | Scenario Outline: User wants to list built-in templates When is provided Then templates should be printed Examples: - | | - | --list | + | | + | --list | Scenario Outline: User wants to use custom template When