Skip to content

Commit

Permalink
Correct docs and skip doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
ug0 committed Jan 15, 2019
1 parent 01e312f commit 9db8248
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
```
Expand Down
16 changes: 8 additions & 8 deletions lib/aliyun_sms.ex
Expand Up @@ -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()
Expand Down
16 changes: 8 additions & 8 deletions lib/aliyun_sms/client.ex
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion 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
2 changes: 1 addition & 1 deletion test/aliyun_sms_test.exs
@@ -1,4 +1,4 @@
defmodule Aliyun.SmsTest do
use ExUnit.Case
doctest Aliyun.Sms
doctest Aliyun.Sms, only: []
end

0 comments on commit 9db8248

Please sign in to comment.