Introduce global state for options so we don't have to pass it around

This commit is contained in:
Uku Taht
2016-03-07 17:53:41 +02:00
parent c105f586bf
commit a59ce4f294
5 changed files with 34 additions and 27 deletions

View File

@@ -2,17 +2,17 @@ defmodule OptionTest do
use ExUnit.Case, async: true
test "has default options" do
options = Options.parse([])
refute Map.fetch!(options, :clear_screen)
Options.parse([])
refute Options.clear_screen?
end
test "override clearing of screen" do
options = Options.parse(["--clear-screen"])
assert Map.fetch!(options, :clear_screen)
Options.parse(["--clear-screen"])
assert Options.clear_screen?
end
test "ignores unknown options" do
options = Options.parse(["--foo"])
refute Map.fetch!(options, :clear_screen)
refute Options.clear_screen?
end
end