jordandobson-posterous 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +6 -0
- data/Rakefile +3 -2
- data/lib/posterous.rb +3 -3
- data/test/test_posterous.rb +5 -0
- metadata +1 -1
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -6,7 +6,8 @@ require './lib/posterous.rb'
|
|
6
6
|
|
7
7
|
Hoe.new('posterous', Posterous::VERSION) do |p|
|
8
8
|
p.developer('Jordan Dobson', 'jordan.dobson@madebysquad.com')
|
9
|
-
p.extra_deps
|
9
|
+
p.extra_deps = ['httparty']
|
10
|
+
p.extra_dev_deps = ['mocha']
|
10
11
|
end
|
11
12
|
|
12
|
-
# vim: syntax=Ruby
|
13
|
+
# vim: syntax=Ruby
|
data/lib/posterous.rb
CHANGED
@@ -3,7 +3,7 @@ require 'httparty'
|
|
3
3
|
|
4
4
|
module Posterous
|
5
5
|
|
6
|
-
VERSION
|
6
|
+
VERSION = '0.1.6'
|
7
7
|
|
8
8
|
class AuthError < StandardError; end
|
9
9
|
class TagError < StandardError; end
|
@@ -23,7 +23,7 @@ module Posterous
|
|
23
23
|
POST_PATH = '/api/newpost'
|
24
24
|
AUTH_PATH = '/api/getsites'
|
25
25
|
|
26
|
-
include
|
26
|
+
include HTTParty
|
27
27
|
base_uri DOMAIN
|
28
28
|
|
29
29
|
attr_accessor :title, :body, :source, :source_url, :date
|
@@ -59,7 +59,7 @@ module Posterous
|
|
59
59
|
case res["site"]
|
60
60
|
when Hash
|
61
61
|
return true unless @site_id
|
62
|
-
|
62
|
+
return @site_id == res["site"]["id"]
|
63
63
|
when Array
|
64
64
|
res["site"].each do |site|
|
65
65
|
return true if @site_id && @site_id == site["id"]
|
data/test/test_posterous.rb
CHANGED
@@ -179,6 +179,11 @@ class TestPosterous < Test::Unit::TestCase
|
|
179
179
|
Posterous::Client.stubs(:post).returns(@resp_ok)
|
180
180
|
assert_equal false, @new_obj_with_bad_id.has_site?
|
181
181
|
end
|
182
|
+
|
183
|
+
def test_has_site_successful_that_site_id_matches_response
|
184
|
+
Posterous::Client.stubs(:post).returns(@resp_ok)
|
185
|
+
assert_equal true, @new_obj_with_id.has_site?
|
186
|
+
end
|
182
187
|
|
183
188
|
def test_has_site_is_successful_on_multiple_when_specified
|
184
189
|
Posterous::Client.stubs(:post).returns(@resp_ok_2_sites)
|