aria2_driver 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2ZlMzFiMDg2MWYxNzA1MGMwMThiZDY5YjdhZDkxYjRlMjVhOGY2MQ==
4
+ YzE2ZGY3MmQzNmVlNjNhZmZmNTM0ODMxODllNzI2ZTI0NGUyOTUyOQ==
5
5
  data.tar.gz: !binary |-
6
- NjhkZWM1OTkwZmJkMGMwMDE1OTJhOGFlNTgwZGJmODMzNDBiODUyZA==
6
+ MmFiZDI5NjVlNThkOWQwOGIyNTQ4MTQyNWQwMGEwNzFlNjllYTE3Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Yjc1MjRkOWM3MGZkNDBhYTZjZDRhODdiMGU0MGY2NTNmZmFlNDZiNzdmMDBk
10
- Mjk0YmQ4ZTJiYTRhMThmOTc4NGUwOTk2YWVjYjJhOGY4NDg3OWUzMmM4YjFh
11
- MWI3MGJlMzEyOTczZmUzNjRmMzNkOTI4NmI0NTRlNTc3YTM3MTQ=
9
+ ZjU3NzEzNzUxY2ViNDU4MDlhODcyNDEyM2EzM2JmNmM4ZTQzODE4YTVlYzU5
10
+ MThiZDU1ODg4MzBhNTU3YzYxMDJiMzVhN2RiZjhmNDkyMzk5YzJiMzJiNTMw
11
+ MDVjZDBlNTc1NmUzNDVmMTA5NmM2NmIxMTRjNTdkOGUzMjdjZDc=
12
12
  data.tar.gz: !binary |-
13
- NmU0Njk2NTkzYTEyZTVkNTFiNDMzMDY5ZjVmOGVkMjI5ODkzMGMyMDk1YWY5
14
- YmUwM2U5MTAzZTU3NTkzNGE5ZDIwNGJmMGJkMDgwNjBkZmI1MzNlODA1MzJj
15
- ODk1OTUxY2NhYzI4YmViMjA3Nzk2ZDJiOGJlMzI3YjM1NDNkODI=
13
+ ZTdlM2ZkZWZmOWVlMmI0NTIzZDBhZGUzNzk2YWMyZTY4ZGFiMmI4ZmMxNjhm
14
+ MmIzODk5M2NlYzAxNzA4NTRiMDI3NmJiNmY1OWFlMDRiODcwMzY1ZWJkMDM4
15
+ NzE0NmI3OThkYmY2NzZhNTQ1Mjk0NTc3ZmQxM2NiMWI4MzIzM2U=
@@ -58,7 +58,7 @@ module Aria2Driver
58
58
  private
59
59
 
60
60
  def supported_request?(request)
61
- [:get_version, :add_uri, :tell_status].include?(request)
61
+ [:get_version, :add_uri, :remove, :tell_status].include?(request)
62
62
  end
63
63
 
64
64
  def snake_lower_camel(snake)
@@ -1,3 +1,3 @@
1
1
  module Aria2Driver
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'support/mocks/json_rpc/get_version'
3
3
  require 'support/mocks/json_rpc/add_uri'
4
+ require 'support/mocks/json_rpc/remove'
4
5
  require 'support/mocks/json_rpc/tell_status'
5
6
 
6
7
  module Aria2Driver
@@ -120,14 +121,34 @@ module Aria2Driver
120
121
  end
121
122
  end
122
123
 
124
+ describe 'remove' do
125
+ it 'remove request' do
126
+ stubbed_request = Mocks::JsonRpc::RemoveRequest.new('localhost',
127
+ {
128
+ port: 80,
129
+ params: [
130
+ 'token:abcd-1234',
131
+ '2089b05ecca3d829'
132
+ ]
133
+ })
134
+ mock_response = Mocks::JsonRpc::RemoveSuccessfulResponse.new
135
+ stubbed_request.with_response(mock_response)
136
+
137
+ response = aria2.remove({params: ['2089b05ecca3d829']})
138
+
139
+ expect(response.error?).to be_falsey
140
+ expect(response.result).to eq(mock_response.result)
141
+ end
142
+ end
143
+
123
144
  describe 'status' do
124
145
  it 'tell_status simple request' do
125
146
  stubbed_request = Mocks::JsonRpc::TellStatusRequest.new('localhost',
126
147
  {
127
148
  port: 80,
128
149
  params: [
129
- "token:abcd-1234",
130
- "2089b05ecca3d829"
150
+ 'token:abcd-1234',
151
+ '2089b05ecca3d829'
131
152
  ]
132
153
  })
133
154
  mock_response = Mocks::JsonRpc::TellStatusSuccessfulResponse.new
@@ -0,0 +1,23 @@
1
+ require_relative './request'
2
+ require_relative './response'
3
+
4
+ module Mocks
5
+ module JsonRpc
6
+
7
+ class RemoveSuccessfulResponse < SuccessfulResponse
8
+ def result
9
+ "2089b05ecca3d829"
10
+ end
11
+ end
12
+
13
+ class RemoveRequest < Request
14
+
15
+ protected
16
+
17
+ def rpc_method
18
+ 'aria2.remove'
19
+ end
20
+
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aria2_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Ciatti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-12 00:00:00.000000000 Z
12
+ date: 2015-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -112,6 +112,7 @@ files:
112
112
  - spec/spec_helper.rb
113
113
  - spec/support/mocks/json_rpc/add_uri.rb
114
114
  - spec/support/mocks/json_rpc/get_version.rb
115
+ - spec/support/mocks/json_rpc/remove.rb
115
116
  - spec/support/mocks/json_rpc/request.rb
116
117
  - spec/support/mocks/json_rpc/response.rb
117
118
  - spec/support/mocks/json_rpc/tell_status.rb
@@ -148,6 +149,7 @@ test_files:
148
149
  - spec/spec_helper.rb
149
150
  - spec/support/mocks/json_rpc/add_uri.rb
150
151
  - spec/support/mocks/json_rpc/get_version.rb
152
+ - spec/support/mocks/json_rpc/remove.rb
151
153
  - spec/support/mocks/json_rpc/request.rb
152
154
  - spec/support/mocks/json_rpc/response.rb
153
155
  - spec/support/mocks/json_rpc/tell_status.rb