Skip to content

Commit

Permalink
fix method name send => ping
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzuruS committed Oct 15, 2019
1 parent d990cdb commit 13f0ccc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
line_notify (1.0.0)
line_notify (1.0.1)

GEM
remote: https://rubygems.org/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -32,7 +32,7 @@ Or install it yourself as:
```ruby
line_notify = LineNotify.new(YOUR_LINE_TOKEN)
options = {message: 'hoge', stickerPackageId: 1, stickerId: 113}
line_notify.send(options)
line_notify.ping(options)

```

Expand All @@ -48,7 +48,7 @@ options = {
imageFullsize: "https://www.pakutaso.com/shared/img/thumb/SAYAPAKU5347_TP_V4.jpg",
imageThumbnail: "https://www.pakutaso.com/shared/img/thumb/SAYAPAKU5347_TP_V.jpg"
}
line_notify.send(options)
line_notify.ping(options)
```

![2018-02-16 0 53 38](https://user-images.githubusercontent.com/1485195/36266096-0ece0310-12b4-11e8-9b7e-67af11dadf9f.png)
Expand Down
2 changes: 1 addition & 1 deletion lib/line_notify/client.rb
Expand Up @@ -9,7 +9,7 @@ def initialize(access_token)
@access_token = (access_token || ENV['LINE_ACCESS_TOKEN'])
end

def send(options)
def ping(options)
request = create_request(options)
Net::HTTP.start(URI.hostname, URI.port, use_ssl: URI.scheme == "https") do |req|
req.request(request)
Expand Down
2 changes: 1 addition & 1 deletion lib/line_notify/version.rb
@@ -1,3 +1,3 @@
module LineNotify
VERSION = "1.0.0"
VERSION = "1.0.1"
end
14 changes: 7 additions & 7 deletions spec/line_notify_spec.rb
Expand Up @@ -4,22 +4,22 @@
@cli = LineNotify.new
end
it "半角英数字メッセージが送信できること" do
res = @cli.send({message: "hoge123"})
res = @cli.ping({message: "hoge123"})
expect(Net::HTTPSuccess === res).to eq true
end

it "日本語メッセージが送信できること" do
res = @cli.send({message: "ふが"})
res = @cli.ping({message: "ふが"})
expect(Net::HTTPSuccess === res).to eq true
end

it "スタンプが送信できること" do
res = @cli.send({message: 'メッセージ', stickerPackageId: 1, stickerId: 113})
res = @cli.ping({message: 'メッセージ', stickerPackageId: 1, stickerId: 113})
expect(Net::HTTPSuccess === res).to eq true
end

it "画像が送信できること" do
res = @cli.send({
res = @cli.ping({
message: '可愛い画像',
imageFullsize: "https://www.pakutaso.com/shared/img/thumb/SAYAPAKU5347_TP_V4.jpg",
imageThumbnail: "https://www.pakutaso.com/shared/img/thumb/SAYAPAKU5347_TP_V.jpg"
Expand All @@ -33,17 +33,17 @@
@cli = LineNotify.new
end
it "空メッセージ" do
res = @cli.send({message: ""})
res = @cli.ping({message: ""})
expect(Net::HTTPSuccess === res).to eq false
end

it "stickerIdがたりない" do
res = @cli.send({message: 'メッセージ', stickerPackageId: 1})
res = @cli.ping({message: 'メッセージ', stickerPackageId: 1})
expect(Net::HTTPSuccess === res).to eq false
end

it "サムネイルが足りない" do
res = @cli.send({
res = @cli.ping({
message: 'メッセージ',
imageFullsize: "https://www.pakutaso.com/shared/img/thumb/SAYAPAKU5347_TP_V4.jpg"
})
Expand Down

0 comments on commit 13f0ccc

Please sign in to comment.