ultron 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ultron.rb +9 -19
- data/lib/ultron/auth.rb +17 -0
- data/lib/ultron/characters.rb +4 -0
- data/lib/ultron/comics.rb +4 -0
- data/lib/ultron/config.rb +1 -2
- data/lib/ultron/connection.rb +9 -9
- data/lib/ultron/creators.rb +4 -0
- data/lib/ultron/entities.rb +69 -0
- data/lib/ultron/events.rb +4 -0
- data/lib/ultron/helpers.rb +0 -16
- data/lib/ultron/series.rb +4 -0
- data/lib/ultron/stories.rb +4 -0
- data/lib/ultron/version.rb +1 -1
- data/spec/cassettes/Ultron_Characters/find_a_character.yml +99 -0
- data/spec/cassettes/Ultron_Characters/should_find_a_character.yml +99 -0
- data/spec/cassettes/Ultron_Characters/should_find_a_list_of_comics_featuring_the_character.yml +1782 -0
- data/spec/cassettes/{Ultron_API_Comic/should_have_the_correct_title.yml → Ultron_Comics/find_a_comic.yml} +8 -8
- data/spec/cassettes/{Ultron_API_Comic/should_have_the_correct_year.yml → Ultron_Comics/should_find_a_comic.yml} +8 -8
- data/spec/cassettes/Ultron_Connection/should_get_a_200.yml +10 -10
- data/spec/cassettes/{Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_creator.yml → Ultron_Creators/should_find_a_list_of_series_by_the_creator.yml} +252 -200
- data/spec/cassettes/Ultron_Events/should_find_a_list_of_stories_for_the_event.yml +346 -0
- data/spec/cassettes/Ultron_Events/should_find_an_event.yml +123 -0
- data/spec/ultron/characters_spec.rb +31 -0
- data/spec/ultron/comics_spec.rb +22 -0
- data/spec/ultron/config_spec.rb +9 -0
- data/spec/ultron/connection_spec.rb +13 -3
- data/spec/ultron/creators_spec.rb +26 -0
- data/spec/ultron/events_spec.rb +26 -0
- metadata +34 -236
- data/lib/ultron/api/character.rb +0 -19
- data/lib/ultron/api/characters.rb +0 -14
- data/lib/ultron/api/comic.rb +0 -15
- data/lib/ultron/api/comics.rb +0 -14
- data/lib/ultron/api/creator.rb +0 -19
- data/lib/ultron/api/creators.rb +0 -14
- data/lib/ultron/api/entities.rb +0 -78
- data/lib/ultron/api/entity.rb +0 -51
- data/lib/ultron/api/event.rb +0 -15
- data/lib/ultron/api/events.rb +0 -14
- data/lib/ultron/api/series.rb +0 -23
- data/lib/ultron/api/serieses.rb +0 -16
- data/lib/ultron/api/stories.rb +0 -14
- data/lib/ultron/api/story.rb +0 -15
- data/spec/cassettes/Ultron_API_Character/should_have_a_series_set.yml +0 -88
- data/spec/cassettes/Ultron_API_Character/should_have_an_events_set.yml +0 -32
- data/spec/cassettes/Ultron_API_Character/should_have_the_correct_name.yml +0 -88
- data/spec/cassettes/Ultron_API_Character/should_have_the_correct_sets/events.yml +0 -32
- data/spec/cassettes/Ultron_API_Character/should_not_have_any_events.yml +0 -32
- data/spec/cassettes/Ultron_API_CharacterSet/should_have_the_correct_first_character.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/characters_filtered_by_comic/should_have_the_correct_first_character.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_comic.yml +0 -1862
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_event.yml +0 -3876
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_series.yml +0 -743
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_story.yml +0 -345
- data/spec/cassettes/Ultron_API_Characters/get_a_character_by_name/should_have_the_correct_id.yml +0 -114
- data/spec/cassettes/Ultron_API_Characters/get_a_character_by_name/should_have_the_correct_name.yml +0 -114
- data/spec/cassettes/Ultron_API_Characters/get_a_character_with_a_space_in_their_name/should_have_the_correct_id.yml +0 -99
- data/spec/cassettes/Ultron_API_Characters/get_a_character_with_a_space_in_their_name/should_have_the_correct_name.yml +0 -99
- data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_id.yml +0 -644
- data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_name.yml +0 -644
- data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_resourceURI.yml +0 -644
- data/spec/cassettes/Ultron_API_Characters/parameterize_the_request/should_let_us_set_multiple_parameters.yml +0 -1595
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_comic.yml +0 -2737
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_event.yml +0 -7345
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_series.yml +0 -743
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_story.yml +0 -231
- data/spec/cassettes/Ultron_API_Characters/should_have_genarate_a_list_of_characters_filtered_by_comic.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/should_have_the_correct_first_character.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/should_not_generate_a_list_of_characters_filtered_by_creator.yml +0 -31
- data/spec/cassettes/Ultron_API_Characters/should_not_generate_lists_of_characters/filtered_by_creator.yml +0 -31
- data/spec/cassettes/Ultron_API_Comic/should_have_a_list_of_characters.yml +0 -46
- data/spec/cassettes/Ultron_API_Comic/should_have_openstruct_method-style_attribute_accessors.yml +0 -46
- data/spec/cassettes/Ultron_API_ComicSet/should_have_the_correct_first_comic.yml +0 -2013
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_character.yml +0 -2059
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_creator.yml +0 -2177
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_event.yml +0 -1701
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_series.yml +0 -123
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_stories.yml +0 -499
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_story.yml +0 -577
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_id.yml +0 -1039
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_name.yml +0 -946
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_resourceURI.yml +0 -1039
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_title.yml +0 -1039
- data/spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_dateRange.yml +0 -1613
- data/spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_limit.yml +0 -96
- data/spec/cassettes/Ultron_API_Comics/should_generate_a_list_of_comics_filtered_by_character.yml +0 -3955
- data/spec/cassettes/Ultron_API_Comics/should_give_me_a_random_comic.yml +0 -118
- data/spec/cassettes/Ultron_API_Comics/should_have_the_correct_first_comic.yml +0 -2012
- data/spec/cassettes/Ultron_API_ComicsSet/should_have_the_correct_first_comic.yml +0 -2013
- data/spec/cassettes/Ultron_API_Creator/it_should_have_the_correct_sets/comics.yml +0 -2029
- data/spec/cassettes/Ultron_API_Creator/should_have_a_comics_set.yml +0 -2022
- data/spec/cassettes/Ultron_API_Creator/should_have_the_correct_comic.yml +0 -2029
- data/spec/cassettes/Ultron_API_Creator/should_have_the_correct_name.yml +0 -243
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_comic.yml +0 -1205
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_event.yml +0 -2778
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_series.yml +0 -4555
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_story.yml +0 -1253
- data/spec/cassettes/Ultron_API_Creators/get_a_creator_by_name/should_return_the_correct_creator.yml +0 -30
- data/spec/cassettes/Ultron_API_Creators/get_the_fourth_creator_off_the_list/should_have_the_right_name.yml +0 -1205
- data/spec/cassettes/Ultron_API_Creators/get_the_second_creator_off_the_list/should_have_the_right_name.yml +0 -384
- data/spec/cassettes/Ultron_API_Creators/should_give_me_a_random_creator.yml +0 -33
- data/spec/cassettes/Ultron_API_Creators/should_have_the_correct_count.yml +0 -113
- data/spec/cassettes/Ultron_API_Creators/should_have_the_correct_first_comic.yml +0 -32
- data/spec/cassettes/Ultron_API_Creators/should_have_the_correct_total.yml +0 -113
- data/spec/cassettes/Ultron_API_Creators/should_not_generate_a_list_of_creators_filtered_by_character.yml +0 -31
- data/spec/cassettes/Ultron_API_Creators/should_not_generate_lists_of_creators/filtered_by_character.yml +0 -31
- data/spec/cassettes/Ultron_API_Event/should_have_a_list_of_characters.yml +0 -195
- data/spec/cassettes/Ultron_API_Event/should_have_the_correct_first_character.yml +0 -195
- data/spec/cassettes/Ultron_API_Event/should_have_the_correct_title.yml +0 -108
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_character.yml +0 -5161
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_comic.yml +0 -363
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_creator.yml +0 -9257
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_series.yml +0 -240
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_story.yml +0 -375
- data/spec/cassettes/Ultron_API_Events/get_the_second_event_off_the_list/should_have_the_right_name.yml +0 -4762
- data/spec/cassettes/Ultron_API_Events/should_give_me_a_random_event.yml +0 -9587
- data/spec/cassettes/Ultron_API_Series/should_have_the_correct_sets/not_series.yml +0 -40
- data/spec/cassettes/Ultron_API_Series/should_have_the_correct_title.yml +0 -40
- data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_character.yml +0 -3618
- data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_comic.yml +0 -31
- data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_event.yml +0 -591
- data/spec/cassettes/Ultron_API_Serieses/get_the_third_event_off_the_list/should_have_the_right_name.yml +0 -1780
- data/spec/cassettes/Ultron_API_Serieses/should_not_generate_lists_of_series/filtered_by_comic.yml +0 -31
- data/spec/cassettes/Ultron_API_Serieses/should_not_generate_lists_of_series/filtered_by_story.yml +0 -31
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_character.yml +0 -342
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_comic.yml +0 -110
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_creator.yml +0 -1041
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_event.yml +0 -846
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_series.yml +0 -143
- data/spec/cassettes/Ultron_API_Stories/get_the_fourth_story_off_the_list/should_have_the_right_name.yml +0 -686
- data/spec/cassettes/Ultron_API_Stories/get_the_second_story_off_the_list/should_have_the_right_name.yml +0 -686
- data/spec/cassettes/Ultron_API_Story/should_have_the_correct_title.yml +0 -40
- data/spec/ultron/api/character_spec.rb +0 -50
- data/spec/ultron/api/comic_spec.rb +0 -51
- data/spec/ultron/api/creator_spec.rb +0 -50
- data/spec/ultron/api/event_spec.rb +0 -50
- data/spec/ultron/api/filtered_sets/characters_filtered_spec.rb +0 -53
- data/spec/ultron/api/filtered_sets/comics_filtered_spec.rb +0 -51
- data/spec/ultron/api/filtered_sets/creators_filtered_spec.rb +0 -51
- data/spec/ultron/api/filtered_sets/events_filtered_spec.rb +0 -51
- data/spec/ultron/api/filtered_sets/series_filtered_spec.rb +0 -50
- data/spec/ultron/api/filtered_sets/stories_filtered_spec.rb +0 -52
- data/spec/ultron/api/series_spec.rb +0 -46
- data/spec/ultron/api/sets/characters_spec.rb +0 -71
- data/spec/ultron/api/sets/comics_spec.rb +0 -53
- data/spec/ultron/api/sets/creators_spec.rb +0 -38
- data/spec/ultron/api/sets/events_spec.rb +0 -35
- data/spec/ultron/api/sets/serieses_spec.rb +0 -26
- data/spec/ultron/api/sets/stories_spec.rb +0 -26
- data/spec/ultron/api/story_spec.rb +0 -46
@@ -1,40 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: http://gateway.marvel.com/v1/public/stories/15820?apikey=<PUBLIC_KEY>&hash=f8366b9e8b1ae6c7ed29d87062efffef&ts=1391894400
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- application/json
|
12
|
-
response:
|
13
|
-
status:
|
14
|
-
code: 200
|
15
|
-
message: OK
|
16
|
-
headers:
|
17
|
-
Etag:
|
18
|
-
- fed251e3fdad05e01d18db456c8d4bad7b8cad97
|
19
|
-
Content-Type:
|
20
|
-
- application/json
|
21
|
-
Content-Length:
|
22
|
-
- '1776'
|
23
|
-
Date:
|
24
|
-
- Mon, 10 Feb 2014 21:27:51 GMT
|
25
|
-
Connection:
|
26
|
-
- keep-alive
|
27
|
-
body:
|
28
|
-
encoding: ASCII-8BIT
|
29
|
-
string: "{\"code\":200,\"status\":\"Ok\",\"etag\":\"fed251e3fdad05e01d18db456c8d4bad7b8cad97\",\"data\":{\"offset\":0,\"limit\":20,\"total\":1,\"count\":1,\"results\":[{\"id\":15820,\"title\":\"Cover
|
30
|
-
#15820\",\"description\":\"\",\"resourceURI\":\"http://gateway.marvel.com/v1/public/stories/15820\",\"type\":\"cover\",\"modified\":\"1969-12-31T19:00:00-0500\",\"thumbnail\":null,\"creators\":{\"available\":4,\"collectionURI\":\"http://gateway.marvel.com/v1/public/stories/15820/creators\",\"items\":[{\"resourceURI\":\"http://gateway.marvel.com/v1/public/creators/1778\",\"name\":\"Dan
|
31
|
-
Crespi\",\"role\":\"letterer\"},{\"resourceURI\":\"http://gateway.marvel.com/v1/public/creators/1519\",\"name\":\"Frank
|
32
|
-
Giacoia\",\"role\":\"inker\"},{\"resourceURI\":\"http://gateway.marvel.com/v1/public/creators/1178\",\"name\":\"Archie
|
33
|
-
Goodwin\",\"role\":\"editor\"},{\"resourceURI\":\"http://gateway.marvel.com/v1/public/creators/1219\",\"name\":\"Ron
|
34
|
-
Wilson\",\"role\":\"penciller (cover)\"}],\"returned\":4},\"characters\":{\"available\":1,\"collectionURI\":\"http://gateway.marvel.com/v1/public/stories/15820/characters\",\"items\":[{\"resourceURI\":\"http://gateway.marvel.com/v1/public/characters/1009262\",\"name\":\"Daredevil\"}],\"returned\":1},\"series\":{\"available\":1,\"collectionURI\":{\"service\":\"comic_storySeries\",\"id\":15820},\"items\":[{\"resourceURI\":\"http://gateway.marvel.com/v1/public/series/2002\",\"name\":\"Daredevil
|
35
|
-
(1963 - 1998)\"}],\"returned\":1},\"comics\":{\"available\":1,\"collectionURI\":\"http://gateway.marvel.com/v1/public/stories/15820/comics\",\"items\":[{\"resourceURI\":\"http://gateway.marvel.com/v1/public/comics/8128\",\"name\":\"Daredevil
|
36
|
-
(1963) #149\"}],\"returned\":1},\"events\":{\"available\":0,\"collectionURI\":\"http://gateway.marvel.com/v1/public/stories/15820/events\",\"items\":[],\"returned\":0},\"originalIssue\":{\"resourceURI\":\"http://gateway.marvel.com/v1/public/comics/8128\",\"name\":\"Daredevil
|
37
|
-
(1963) #149\"}}]}}"
|
38
|
-
http_version:
|
39
|
-
recorded_at: Sat, 08 Feb 2014 21:20:00 GMT
|
40
|
-
recorded_with: VCR 2.8.0
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Character do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@character = Ultron::API::Character.new '1009496'
|
9
|
-
end
|
10
|
-
|
11
|
-
context 'should have the correct sets' do
|
12
|
-
it 'comics', :vcr do
|
13
|
-
@character.comics.class.should == Comics
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'events', :vcr do
|
17
|
-
@character.events.class.should == Events
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'series', :vcr do
|
21
|
-
@character.serieses.class.should == Serieses
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'stories', :vcr do
|
25
|
-
@character.stories.class.should == Stories
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'not characters', :vcr do
|
29
|
-
@character.characters.class.should == NilClass
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'not creators', :vcr do
|
33
|
-
@character.creators.class.should == NilClass
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should have the correct name', :vcr do
|
38
|
-
@character['name'].should == 'Phoenix'
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'should not have any events', :vcr do
|
42
|
-
@character.has_events?.should == false
|
43
|
-
end
|
44
|
-
|
45
|
-
after :each do
|
46
|
-
Timecop.return
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Comic do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@comic = Ultron::API::Comic.new 12518
|
9
|
-
end
|
10
|
-
|
11
|
-
context 'should have the correct sets' do
|
12
|
-
it 'characters', :vcr do
|
13
|
-
@comic.characters.class.should == Characters
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'creators', :vcr do
|
17
|
-
@comic.creators.class.should == Creators
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'events', :vcr do
|
21
|
-
@comic.events.class.should == Events
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'series', :vcr do
|
25
|
-
@comic.serieses.class.should == Serieses
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'stories', :vcr do
|
29
|
-
@comic.stories.class.should == Stories
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'not comics', :vcr do
|
33
|
-
@comic.comics.class.should == NilClass
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should have the correct title', :vcr do
|
38
|
-
@comic['title'].should == 'Uncanny X-Men (1963) #67'
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'should give me a story' do
|
42
|
-
story = @comic.stories[0]
|
43
|
-
story.class.should == Story
|
44
|
-
end
|
45
|
-
|
46
|
-
after :each do
|
47
|
-
Timecop.return
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Creator do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@creator = Ultron::API::Creator.new 196
|
9
|
-
end
|
10
|
-
|
11
|
-
context 'it should have the correct sets' do
|
12
|
-
it 'comics', :vcr do
|
13
|
-
@creator.comics.class.should == Comics
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'events', :vcr do
|
17
|
-
@creator.events.class.should == Events
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'serieses', :vcr do
|
21
|
-
@creator.serieses.class.should == Serieses
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'stories', :vcr do
|
25
|
-
@creator.stories.class.should == Stories
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'not characters', :vcr do
|
29
|
-
@creator.characters.class.should == NilClass
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'not creators', :vcr do
|
33
|
-
@creator.creators.class.should == NilClass
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should have the correct name', :vcr do
|
38
|
-
@creator['fullName'].should == 'Jack Kirby'
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'should have the correct comic', :vcr do
|
42
|
-
@creator.comics[0]['title'].should == 'THE FANTASTIC FOUR OMNIBUS VOL. 2 HC (NEW PRINTING) (Hardcover)'
|
43
|
-
end
|
44
|
-
|
45
|
-
after :each do
|
46
|
-
Timecop.return
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Event do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@event = Ultron::API::Event.new 314
|
9
|
-
end
|
10
|
-
|
11
|
-
context 'should have the correct sets' do
|
12
|
-
it 'characters', :vcr do
|
13
|
-
@event.characters.class.should == Characters
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'comics', :vcr do
|
17
|
-
@event.comics.class.should == Comics
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'creators', :vcr do
|
21
|
-
@event.creators.class.should == Creators
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'series', :vcr do
|
25
|
-
@event.serieses.class.should == Serieses
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'stories', :vcr do
|
29
|
-
@event.stories.class.should == Stories
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'not events', :vcr do
|
33
|
-
@event.events.class.should == NilClass
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should have the correct title', :vcr do
|
38
|
-
@event['title'].should == 'Age of Ultron'
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'should have the correct first character', :vcr do
|
42
|
-
@event.characters[0]['name'].should == 'Ultron'
|
43
|
-
end
|
44
|
-
|
45
|
-
after :each do
|
46
|
-
Timecop.return
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Characters do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
end
|
9
|
-
|
10
|
-
context 'generate filtered lists of characters' do
|
11
|
-
it 'by comic', :vcr do
|
12
|
-
set = Characters.new 'comics/29506/characters'
|
13
|
-
char = set[0]
|
14
|
-
char.class.should == Character
|
15
|
-
char['id'].should == 1009257
|
16
|
-
char['name'].should == 'Cyclops'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'by event', :vcr do
|
20
|
-
set = Characters.new 'events/116/characters'
|
21
|
-
char = set[-1]
|
22
|
-
char['id'].should == 1009282
|
23
|
-
char['name'].should == 'Doctor Strange'
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'by series', :vcr do
|
27
|
-
char = Characters.new('series/150/characters')[1]
|
28
|
-
char.class.should == Character
|
29
|
-
char['id'].should == 1009368
|
30
|
-
char['name'].should == 'Iron Man'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'by story', :vcr do
|
34
|
-
set = Characters.new 'stories/44081/characters'
|
35
|
-
char = set[0]
|
36
|
-
char['id'].should == 1009726
|
37
|
-
char['name'].should == 'X-Men'
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
context 'should not generate lists of characters' do
|
42
|
-
it 'filtered by creator', :vcr do
|
43
|
-
set = Characters.new 'creators/1234/characters'
|
44
|
-
set.any?.should == false
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
after :each do
|
49
|
-
Timecop.return
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Comics do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
end
|
9
|
-
|
10
|
-
context 'generate filtered lists of comics' do
|
11
|
-
it 'by character', :vcr do
|
12
|
-
set = Comics.new 'characters/1009496/comics'
|
13
|
-
comic = set[0]
|
14
|
-
comic.class.should == Comic
|
15
|
-
comic['id'].should == 41839
|
16
|
-
comic['title'].should == 'Uncanny X-Force (2010) #13 (2nd Printing Variant)'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'by creator', :vcr do
|
20
|
-
set = Comics.new 'creators/196/comics'
|
21
|
-
comic = set[-1]
|
22
|
-
comic['id'].should == 46245
|
23
|
-
comic['title'].should == 'Marvel Masterworks: Golden Age All-Winners (Trade Paperback)'
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'by event', :vcr do
|
27
|
-
comic = Comics.new('events/314/comics')[0]
|
28
|
-
comic['id'].should == 48176
|
29
|
-
comic['title'].should == 'Hunger (2013) #4'
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'by series', :vcr do
|
33
|
-
set = Comics.new 'series/3688/comics'
|
34
|
-
comic = set[-1]
|
35
|
-
comic['id'].should == 18830
|
36
|
-
comic['title'].should == 'Spider-Man & Wolverine (2003) #4'
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'by story', :vcr do
|
40
|
-
comic = Comics.new('stories/3228/comics')[0]
|
41
|
-
comic['id'].should == 5032
|
42
|
-
comic['title'].should == 'X-Men: The End Book 3: Men and X-Men (Trade Paperback)'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
after :each do
|
47
|
-
Timecop.return
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Creators do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
end
|
9
|
-
|
10
|
-
context 'generate filtered lists of creators' do
|
11
|
-
it 'by comic', :vcr do
|
12
|
-
set = Creators.new 'comics/40452/creators'
|
13
|
-
creator = set[0]
|
14
|
-
creator['id'].should == 361
|
15
|
-
creator['fullName'].should == 'Cory Petit'
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'by event', :vcr do
|
19
|
-
creator = Creators.new('events/212/creators')[0]
|
20
|
-
creator.class.should == Creator
|
21
|
-
creator['id'].should == 1126
|
22
|
-
creator['fullName'].should == 'Juan Santa Cruz'
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'by series', :vcr do
|
26
|
-
set = Creators.new 'series/1137/creators'
|
27
|
-
set[0]['id'].should == 24
|
28
|
-
set[0]['fullName'].should == 'Brian Michael Bendis'
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'by story', :vcr do
|
32
|
-
set = Creators.new 'stories/49846/creators'
|
33
|
-
creator = set[-1]
|
34
|
-
creator['id'].should == 454
|
35
|
-
creator['fullName'].should == 'Mark Morales'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
context 'should not generate lists of creators' do
|
40
|
-
it 'filtered by character', :vcr do
|
41
|
-
set = Creators.new 'character/4321/creators'
|
42
|
-
set.any?.should == false
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
after :each do
|
47
|
-
Timecop.return
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Events do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
end
|
9
|
-
|
10
|
-
context 'generate filtered lists of events' do
|
11
|
-
it 'by character', :vcr do
|
12
|
-
set = Events.new 'characters/1009368/events'
|
13
|
-
event = set[-1]
|
14
|
-
event.class.should == Event
|
15
|
-
event['id'].should == 270
|
16
|
-
event['title'].should == 'Secret Wars'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'by comic', :vcr do
|
20
|
-
event = Events.new('comics/6669/events')[0]
|
21
|
-
event['id'].should == 271
|
22
|
-
event['title'].should == 'Secret Wars II'
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'by creator', :vcr do
|
26
|
-
set = Events.new 'creators/214/events'
|
27
|
-
set[0]['id'].should == 116
|
28
|
-
set[0]['title'].should == 'Acts of Vengeance!'
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'by series', :vcr do
|
32
|
-
set = Events.new 'series/489/events'
|
33
|
-
event = set[0]
|
34
|
-
event['id'].should == 32
|
35
|
-
event['title'].should == 'Kings of Pain'
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'by story', :vcr do
|
39
|
-
set = Events.new 'stories/1203/events'
|
40
|
-
event = set[0]
|
41
|
-
event['id'].should == 238
|
42
|
-
event['title'].should == 'Civil War'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
after :each do
|
47
|
-
Timecop.return
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|