-Code.require_file "test_helper.exs", __DIR__
+Code.require_file("test_helper.exs", __DIR__)
 
 defmodule OptionParserTest do
   use ExUnit.Case, async: true

  end

  test "parse_head!/2 raise an exception when an option is of the wrong type" do
    assert_raise OptionParser.ParseError, "1 error found!\n--number : Expected type integer, got \"lib\"", fn ->
      argv = ["--number", "lib", "test/enum_test.exs"]
      OptionParser.parse_head!(argv, strict: [number: :integer])
    end

  end

  test "to_argv" do
    assert OptionParser.to_argv(foo_bar: "baz") == ["--foo-bar", "baz"]

    assert OptionParser.to_argv(bool: true, bool: false, discarded: nil) ==
             ["--bool", "--no-bool"]
  end

  test ":count switch type can be translated back" do
    original = ["--counter", "--counter"]
    {opts, [], []} = OptionParser.parse(original, switches: [counter: :count])
    assert original == OptionParser.to_argv(opts, switches: [counter: :count])
  end
end
