diff --git a/.github/workflows/test_with_deepl_mock.yml b/.github/workflows/test_with_deepl_mock.yml index 9aa0369..01c474e 100644 --- a/.github/workflows/test_with_deepl_mock.yml +++ b/.github/workflows/test_with_deepl_mock.yml @@ -58,7 +58,7 @@ jobs: run: shards install --without-development - name: Run tests - run: crystal spec + run: crystal spec -Ddeepl_mock env: DEEPL_SERVER_URL: http://localhost:3000 HTTP_PROXY: http://localhost:3001 diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index 59c2621..f86d98b 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -1,3 +1,6 @@ require "spec" +{% if flag?(:deepl_mock) %} +STDERR.puts " Using mock for DeepL API ".colorize.back(:magenta) require "./crest_extension_for_mock" +{% end %} require "../src/deepl"