From 9db824856708b85b9f93c725203e3912ef445a0b Mon Sep 17 00:00:00 2001 From: ug0 Date: Tue, 15 Jan 2019 10:19:19 +0800 Subject: [PATCH] Correct docs and skip doctests --- README.md | 2 +- lib/aliyun_sms.ex | 16 ++++++++-------- lib/aliyun_sms/client.ex | 16 ++++++++-------- mix.exs | 2 +- test/aliyun_sms/client_test.exs | 2 +- test/aliyun_sms_test.exs | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0415ed7..8e8e8f5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ by adding `aliyun_sms` to your list of dependencies in `mix.exs`: ```elixir def deps do [ - {:aliyun_sms, "~> 0.2.1"} + {:aliyun_sms, "~> 0.2.2"} ] end ``` diff --git a/lib/aliyun_sms.ex b/lib/aliyun_sms.ex index fa28b78..4a4af17 100644 --- a/lib/aliyun_sms.ex +++ b/lib/aliyun_sms.ex @@ -4,17 +4,17 @@ defmodule Aliyun.Sms do ## Examples - iex> Aliyun.Sms.send("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) - {:ok, %{"Code" => "OK", "Message" => "OK", ...}} + iex> Aliyun.Sms.send_sms("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) + {:ok, %{"Code" => "OK", "Message" => "OK", "BizId" => "700000000000000000^0", "RequestId" => "A0000000-3CC1-4000-8000-E00000000000"}} - iex> Aliyun.Sms.send("1500000000", "invalid_sig", "SMS_0000", %{code: "222333"}) - {:error, code, %{"Code" => "isv.SMS_SIGNATURE_ILLEGAL", "Message" => "短信签名不合法"}} + iex> Aliyun.Sms.send_sms("1500000000", "invalid_sig", "SMS_0000", %{code: "222333"}) + {:error, "isv.SMS_SIGNATURE_ILLEGAL", %{"Code" => "isv.SMS_SIGNATURE_ILLEGAL", "Message" => "短信签名不合法"}} - iex> Aliyun.Sms.send("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) - {:error, :http_error, reason} + iex> Aliyun.Sms.send_sms("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) + {:error, :http_error, "REASON"} - iex> Aliyun.Sms.send("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) - {:error, :json_decode_error, body} + iex> Aliyun.Sms.send_sms("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) + {:error, :json_decode_error, "BODY"} """ @type error_code() :: :http_error | :json_decode_error | String.t() diff --git a/lib/aliyun_sms/client.ex b/lib/aliyun_sms/client.ex index 9158de9..135c643 100644 --- a/lib/aliyun_sms/client.ex +++ b/lib/aliyun_sms/client.ex @@ -7,17 +7,17 @@ defmodule Aliyun.Sms.Client do ## Examples - iex> Aliyun.Sms.Client.send("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) - {:ok, %{"Code" => "OK", "Message" => "OK", ...}} + iex> Aliyun.Sms.Client.send_sms("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) + {:ok, %{"Code" => "OK", "Message" => "OK", "BizId" => "700000000000000000^0", "RequestId" => "A0000000-3CC1-4000-8000-E00000000000"}} - iex> Aliyun.Sms.Client.send("1500000000", "invalid_sig", "SMS_0000", %{code: "222333"}) - {:error, code, %{"Code" => "isv.SMS_SIGNATURE_ILLEGAL", "Message" => "短信签名不合法"}} + iex> Aliyun.Sms.Client.send_sms("1500000000", "invalid_sig", "SMS_0000", %{code: "222333"}) + {:error, "isv.SMS_SIGNATURE_ILLEGAL", %{"Code" => "isv.SMS_SIGNATURE_ILLEGAL", "Message" => "短信签名不合法"}} - iex> Aliyun.Sms.Client.send("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) - {:error, :http_error, reason} + iex> Aliyun.Sms.Client.send_sms("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) + {:error, :http_error, "REASON"} - iex> Aliyun.Sms.Client.send("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) - {:error, :json_decode_error, body} + iex> Aliyun.Sms.Client.send_sms("1500000000", "阿里云短信测试专用", "SMS_0000", %{code: "222333"}) + {:error, :json_decode_error, "BODY"} """ @type error_code() :: :http_error | :json_decode_error | String.t() diff --git a/mix.exs b/mix.exs index f588fbb..bfbf357 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule AliyunSms.MixProject do def project do [ app: :aliyun_sms, - version: "0.2.1", + version: "0.2.2", elixir: "~> 1.7", start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/test/aliyun_sms/client_test.exs b/test/aliyun_sms/client_test.exs index 738130f..ae42509 100644 --- a/test/aliyun_sms/client_test.exs +++ b/test/aliyun_sms/client_test.exs @@ -1,4 +1,4 @@ defmodule Aliyun.Sms.ClientTest do use ExUnit.Case - doctest Aliyun.Sms.Client + doctest Aliyun.Sms.Client, only: [] end diff --git a/test/aliyun_sms_test.exs b/test/aliyun_sms_test.exs index 420eeba..3df61db 100644 --- a/test/aliyun_sms_test.exs +++ b/test/aliyun_sms_test.exs @@ -1,4 +1,4 @@ defmodule Aliyun.SmsTest do use ExUnit.Case - doctest Aliyun.Sms + doctest Aliyun.Sms, only: [] end