hypem 0.2.0 → 0.2.1
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/hypem.gemspec +3 -1
- data/lib/hypem.rb +2 -0
- data/lib/hypem/blog.rb +9 -22
- data/lib/hypem/helper.rb +37 -0
- data/lib/hypem/playlist.rb +12 -16
- data/lib/hypem/request.rb +14 -18
- data/lib/hypem/track.rb +19 -28
- data/lib/hypem/user.rb +26 -35
- data/lib/hypem/version.rb +1 -1
- data/spec/blog_spec.rb +5 -11
- data/spec/fixtures/vcr_cassettes/blog.yml +44 -0
- data/{fixtures → spec/fixtures}/vcr_cassettes/blog_all.yml +98 -143
- data/spec/fixtures/vcr_cassettes/latest_playlist.yml +238 -0
- data/spec/fixtures/vcr_cassettes/single_track.yml +48 -0
- data/spec/fixtures/vcr_cassettes/user_favorite_blogs.yml +68 -0
- data/spec/fixtures/vcr_cassettes/user_friends.yml +46 -0
- data/spec/fixtures/vcr_cassettes/user_profile.yml +46 -0
- data/spec/playlist_spec.rb +2 -8
- data/spec/request_spec.rb +0 -28
- data/spec/spec_helper.rb +3 -3
- data/spec/track_spec.rb +2 -5
- data/spec/user_spec.rb +5 -5
- metadata +53 -33
- data/fixtures/vcr_cassettes/blog.yml +0 -42
- data/fixtures/vcr_cassettes/blog_playlist.yml +0 -156
- data/fixtures/vcr_cassettes/feed_playlist.yml +0 -150
- data/fixtures/vcr_cassettes/fresh_playlist.yml +0 -230
- data/fixtures/vcr_cassettes/friends_history.yml +0 -144
- data/fixtures/vcr_cassettes/friends_playlist.yml +0 -150
- data/fixtures/vcr_cassettes/latest_playlist.yml +0 -216
- data/fixtures/vcr_cassettes/loved_playlist.yml +0 -146
- data/fixtures/vcr_cassettes/obsessed_playlist.yml +0 -151
- data/fixtures/vcr_cassettes/popular_playlist.yml +0 -167
- data/fixtures/vcr_cassettes/single_track.yml +0 -47
- data/fixtures/vcr_cassettes/user_favorite_blogs.yml +0 -61
- data/fixtures/vcr_cassettes/user_friends.yml +0 -44
- data/fixtures/vcr_cassettes/user_profile.yml +0 -44
- data/spec/response_spec.rb +0 -36
@@ -1,44 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: http://hypem.com/api/get_profile?username=jackca
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers: {}
|
10
|
-
response:
|
11
|
-
status:
|
12
|
-
code: 200
|
13
|
-
message:
|
14
|
-
headers:
|
15
|
-
server:
|
16
|
-
- nginx/1.0.12
|
17
|
-
date:
|
18
|
-
- Sat, 24 Mar 2012 22:07:39 GMT
|
19
|
-
content-type:
|
20
|
-
- text/javascript; charset=UTF-8
|
21
|
-
transfer-encoding:
|
22
|
-
- chunked
|
23
|
-
connection:
|
24
|
-
- close
|
25
|
-
set-cookie:
|
26
|
-
- AUTH=03%3A1536f8f35d43a41d289bf5cbf9e227d7%3A1332626858%3A1276002699%3ACA-US;
|
27
|
-
expires=Mon, 20-Mar-2028 22:07:38 GMT; path=/; domain=hypem.com
|
28
|
-
x-hacker:
|
29
|
-
- Hey, if you're reading this, you should drop us an email at hypem.com/contact,
|
30
|
-
maybe we can work together!
|
31
|
-
access-control-allow-origin:
|
32
|
-
- ! '*'
|
33
|
-
access-control-allow-headers:
|
34
|
-
- ! '*'
|
35
|
-
vary:
|
36
|
-
- Accept-Encoding
|
37
|
-
body:
|
38
|
-
encoding: ASCII-8BIT
|
39
|
-
string: ! '{"username":"JackCA","profile_url":"http:\/\/hypem.com\/JackCA","fullname":"Jack
|
40
|
-
Anderson","twitter_username":"janderson","userpic":"http:\/\/faces-s3.hypem.com\/123376863051420_75.png","joined_ts":1238371615,"favorites_count":{"user":4,"item":430,"site":32,"query":15,"followers":1},"location":"San
|
41
|
-
Francisco, CA, US"}'
|
42
|
-
http_version:
|
43
|
-
recorded_at: Sat, 24 Mar 2012 22:07:39 GMT
|
44
|
-
recorded_with: VCR 2.0.0
|
data/spec/response_spec.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Hypem::Response do
|
4
|
-
|
5
|
-
context "at initialization" do
|
6
|
-
let(:request) do
|
7
|
-
Hypem::Request.new('/playlist/latest/fresh/json/1')
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:gotten_request) do
|
11
|
-
VCR.use_cassette('fresh_playlist') do
|
12
|
-
request.get
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:response) do
|
17
|
-
described_class.new(gotten_request)
|
18
|
-
end
|
19
|
-
|
20
|
-
it "uses a raw response parameter" do
|
21
|
-
response.body.should_not be_nil
|
22
|
-
end
|
23
|
-
|
24
|
-
it "assigns the body attribute" do
|
25
|
-
response.body.should be_a Hash
|
26
|
-
end
|
27
|
-
|
28
|
-
it "raises RequestError with null body" do
|
29
|
-
raw_response = double('RawResponse')
|
30
|
-
raw_response.stub(:body).and_return('null')
|
31
|
-
expect { described_class.new(raw_response) }.to raise_error Hypem::RequestError
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
end
|