rtmapi 0.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rtmapi.rb +3 -3
- data/test/data/test_rtm_tasks_getList_with_only_one_task.1.xml +2 -0
- data/test/test-rtmapi.rb +12 -2
- metadata +2 -1
data/lib/rtmapi.rb
CHANGED
@@ -242,8 +242,8 @@ class RememberTheMilk
|
|
242
242
|
new_hash[list[:id]] = process_task_list( list[:id], list.arrayify_value(:taskseries) )
|
243
243
|
end
|
244
244
|
data = new_hash
|
245
|
-
elsif data.class ==
|
246
|
-
data = process_task_list( data[:id], data
|
245
|
+
elsif data.class == RememberTheMilkHash # only one list
|
246
|
+
data = process_task_list( data[:id], data.arrayify_value(:taskseries) )
|
247
247
|
elsif data.class == NilClass # empty list
|
248
248
|
data = new_hash
|
249
249
|
else # who knows...
|
@@ -367,9 +367,9 @@ class RememberTheMilk
|
|
367
367
|
|
368
368
|
raw_data = @xml_parser.parse
|
369
369
|
data = xml_node_to_hash( raw_data.root )
|
370
|
+
debug( "processed into data<#{data.inspect}>")
|
370
371
|
|
371
372
|
if data[:stat] != 'ok'
|
372
|
-
debug( "processed into data<#{data.inspect}>")
|
373
373
|
error = RememberTheMilkAPIError.new(data[:err],method,args)
|
374
374
|
debug( "%s", error )
|
375
375
|
raise error
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<rsp stat="ok"><tasks><list id="426012"><taskseries id="2478134" created="2007-02-05T15:52:04Z" modified="2007-02-05T15:52:04Z" name="only one task in this list" source="js" url=""><tags/><participants/><notes/><task id="3459806" due="" has_due_time="0" added="2007-02-05T15:52:04Z" completed="" deleted="" priority="N" postponed="0" estimate=""/></taskseries></list></tasks></rsp>
|
data/test/test-rtmapi.rb
CHANGED
@@ -18,6 +18,7 @@
|
|
18
18
|
# (c) 2006, QuantumFoam.org, Inc.
|
19
19
|
|
20
20
|
|
21
|
+
require 'rubygems'
|
21
22
|
require 'rtmapi'
|
22
23
|
require 'test/unit'
|
23
24
|
|
@@ -49,9 +50,9 @@ class RememberTheMilkTester < RememberTheMilk
|
|
49
50
|
debug('Grabbed data from %s: %s', filename, args[:test_data])
|
50
51
|
else
|
51
52
|
# write the data to the cache
|
52
|
-
return_raw_response = true
|
53
|
+
@return_raw_response = true
|
53
54
|
response = super( method, args )
|
54
|
-
return_raw_response = false
|
55
|
+
@return_raw_response = false
|
55
56
|
|
56
57
|
File.open( filename, "w" ) {|file| file.write(response)}
|
57
58
|
args[:test_data] = response
|
@@ -249,6 +250,15 @@ class TestRememberTheMilk < Test::Unit::TestCase
|
|
249
250
|
assert_raise(RuntimeError) { data['782838'].this_is_not_a_valid_key }
|
250
251
|
end
|
251
252
|
|
253
|
+
def test_rtm_tasks_getList_with_only_one_task
|
254
|
+
list_id = "426012"
|
255
|
+
data = @rtm.tasks.getList( :list_id => list_id )
|
256
|
+
assert_equal RememberTheMilkHash, data.class
|
257
|
+
assert_equal 1, data.keys.size
|
258
|
+
assert_equal "only one task in this list", data.values[0].name
|
259
|
+
end
|
260
|
+
|
261
|
+
|
252
262
|
def test_rtm_get_task_and_is_complete
|
253
263
|
data = @rtm.tasks.getList( :list_id => '421865' )
|
254
264
|
assert_equal RememberTheMilkHash, data.class
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.1
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rtmapi
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version:
|
6
|
+
version: 0.6.1
|
7
7
|
date: 2007-02-01 00:00:00 -05:00
|
8
8
|
summary: Simple library for interfacing with rememberthemilk.com.
|
9
9
|
require_paths:
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- test/data/test_rtm_tasks_getList.1.xml
|
69
69
|
- test/data/test_rtm_tasks_getList_all.1.xml
|
70
70
|
- test/data/test_rtm_tasks_getList_from_smartlist.1.xml
|
71
|
+
- test/data/test_rtm_tasks_getList_with_only_one_task.1.xml
|
71
72
|
- test/data/test_rtm_tasks_setDueDate.1.xml
|
72
73
|
- test/data/test_rtm_tasks_setDueDate.2.xml
|
73
74
|
- test/data/test_rtm_tasks_setDueDate.3.xml
|