From 03dd6a3e315c97022b29ee15229f3e3c838a2383 Mon Sep 17 00:00:00 2001 From: Andrew Forward Date: Fri, 8 Sep 2017 06:05:04 -0700 Subject: [PATCH] Fix but where X.0.Y was registering as a major change --- lib/mix/tasks/name.ex | 2 +- test/tasks/name_test.exs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mix/tasks/name.ex b/lib/mix/tasks/name.ex index ca38415..e838e9f 100644 --- a/lib/mix/tasks/name.ex +++ b/lib/mix/tasks/name.ex @@ -15,7 +15,7 @@ defmodule Mix.Tasks.Version.Name do |> name end - defp name([_, "0", _]), do: :major + defp name([_, "0", "0"]), do: :major defp name([_, _, "0"]), do: :minor defp name(_), do: :patch diff --git a/test/tasks/name_test.exs b/test/tasks/name_test.exs index b1096d0..a387cef 100644 --- a/test/tasks/name_test.exs +++ b/test/tasks/name_test.exs @@ -5,11 +5,13 @@ defmodule Mix.Tasks.Version.NameTest do test "name" do assert :patch == Name.calc("1.2.3") assert :patch == Name.calc("1.2.30") + assert :patch == Name.calc("2.0.1") assert :minor == Name.calc("0.1.0") assert :minor == Name.calc("1.4.0") assert :major == Name.calc("1.0.0") assert :major == Name.calc("2.0.0") + end end