spec/helpers/stubs.rb in transmission-rpc-ruby-0.1.0 vs spec/helpers/stubs.rb in transmission-rpc-ruby-0.2.0
- old
+ new
@@ -12,20 +12,34 @@
stub_rpc_request
.with(body: torrent_get_body(body))
.to_return(successful_response({arguments: {torrents: torrents}}))
end
+ def stub_get_session(fields)
+ stub_rpc_request
+ .with(body: session_get_body({fields: fields}))
+ .to_return(successful_response)
+ end
+
def torrent_get_body(arguments = {})
- args = {fields: Transmission::Arguments::TorrentGet.new.to_arguments}.merge(arguments)
+ args = {fields: Transmission::Fields::TorrentGet.new.to_fields}.merge(arguments)
{method: 'torrent-get', arguments: args}.to_json
end
def torrent_add_body(arguments = {})
{method: 'torrent-add', arguments: arguments}.to_json
end
def torrent_remove_body(arguments = {})
{method: 'torrent-remove', arguments: arguments}.to_json
+ end
+
+ def torrent_set_body(arguments = {})
+ {method: 'torrent-set', arguments: arguments}.to_json
+ end
+
+ def torrent_method_body(method, arguments)
+ {method: method, arguments: arguments}.to_json
end
def session_get_body(arguments = {})
{method: 'session-get', arguments: arguments}.to_json
end
\ No newline at end of file