ultron 0.0.1 → 0.0.2

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.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.rspec +1 -1
  4. data/.travis.yml +7 -0
  5. data/{LICENSE.txt → LICENSE.md} +2 -2
  6. data/README.md +19 -21
  7. data/Rakefile +1 -1
  8. data/config/params.yaml +0 -0
  9. data/config/ultron.yaml +2 -0
  10. data/examples/links.rb +0 -0
  11. data/lib/ultron.rb +29 -4
  12. data/lib/ultron/api/character.rb +19 -0
  13. data/lib/ultron/api/characters.rb +14 -0
  14. data/lib/ultron/api/comic.rb +15 -0
  15. data/lib/ultron/api/comics.rb +14 -0
  16. data/lib/ultron/api/creator.rb +19 -0
  17. data/lib/ultron/api/creators.rb +14 -0
  18. data/lib/ultron/api/entities.rb +45 -0
  19. data/lib/ultron/api/entity.rb +51 -0
  20. data/lib/ultron/api/event.rb +15 -0
  21. data/lib/ultron/api/events.rb +14 -0
  22. data/lib/ultron/api/series.rb +23 -0
  23. data/lib/ultron/api/serieses.rb +16 -0
  24. data/lib/ultron/api/stories.rb +14 -0
  25. data/lib/ultron/api/story.rb +15 -0
  26. data/lib/ultron/config.rb +35 -0
  27. data/lib/ultron/connection.rb +41 -0
  28. data/lib/ultron/helpers.rb +25 -0
  29. data/lib/ultron/version.rb +1 -1
  30. data/spec/cassettes/Ultron_API_Character/should_have_a_series_set.yml +88 -0
  31. data/spec/cassettes/Ultron_API_Character/should_have_an_events_set.yml +32 -0
  32. data/spec/cassettes/Ultron_API_Character/should_have_the_correct_name.yml +88 -0
  33. data/spec/cassettes/Ultron_API_Character/should_have_the_correct_sets/events.yml +32 -0
  34. data/spec/cassettes/Ultron_API_Character/should_not_have_any_events.yml +32 -0
  35. data/spec/cassettes/Ultron_API_CharacterSet/should_have_the_correct_first_character.yml +1616 -0
  36. data/spec/cassettes/Ultron_API_Characters/characters_filtered_by_comic/should_have_the_correct_first_character.yml +1616 -0
  37. data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_comic.yml +1862 -0
  38. data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_event.yml +3876 -0
  39. data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_series.yml +743 -0
  40. data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_story.yml +345 -0
  41. data/spec/cassettes/Ultron_API_Characters/get_a_character_by_name/should_have_the_correct_id.yml +114 -0
  42. data/spec/cassettes/Ultron_API_Characters/get_a_character_by_name/should_have_the_correct_name.yml +114 -0
  43. data/spec/cassettes/Ultron_API_Characters/get_a_character_with_a_space_in_their_name/should_have_the_correct_id.yml +99 -0
  44. data/spec/cassettes/Ultron_API_Characters/get_a_character_with_a_space_in_their_name/should_have_the_correct_name.yml +99 -0
  45. data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_id.yml +644 -0
  46. data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_name.yml +644 -0
  47. data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_resourceURI.yml +644 -0
  48. data/spec/cassettes/Ultron_API_Characters/parameterize_the_request/should_let_us_set_multiple_parameters.yml +1595 -0
  49. data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_comic.yml +2737 -0
  50. data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_event.yml +7345 -0
  51. data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_series.yml +743 -0
  52. data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_story.yml +231 -0
  53. data/spec/cassettes/Ultron_API_Characters/should_have_genarate_a_list_of_characters_filtered_by_comic.yml +1616 -0
  54. data/spec/cassettes/Ultron_API_Characters/should_have_the_correct_first_character.yml +1616 -0
  55. data/spec/cassettes/Ultron_API_Characters/should_not_generate_a_list_of_characters_filtered_by_creator.yml +31 -0
  56. data/spec/cassettes/Ultron_API_Characters/should_not_generate_lists_of_characters/filtered_by_creator.yml +31 -0
  57. data/spec/cassettes/Ultron_API_Comic/should_have_a_list_of_characters.yml +46 -0
  58. data/spec/cassettes/Ultron_API_Comic/should_have_openstruct_method-style_attribute_accessors.yml +46 -0
  59. data/spec/cassettes/Ultron_API_Comic/should_have_the_correct_title.yml +46 -0
  60. data/spec/cassettes/Ultron_API_Comic/should_have_the_correct_year.yml +46 -0
  61. data/spec/cassettes/Ultron_API_ComicSet/should_have_the_correct_first_comic.yml +2013 -0
  62. data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_character.yml +2059 -0
  63. data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_creator.yml +2177 -0
  64. data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_event.yml +1701 -0
  65. data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_series.yml +123 -0
  66. data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_stories.yml +499 -0
  67. data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_story.yml +577 -0
  68. data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_id.yml +1039 -0
  69. data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_name.yml +946 -0
  70. data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_resourceURI.yml +1039 -0
  71. data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_title.yml +1039 -0
  72. data/spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_dateRange.yml +1613 -0
  73. data/spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_limit.yml +96 -0
  74. data/spec/cassettes/Ultron_API_Comics/should_generate_a_list_of_comics_filtered_by_character.yml +3955 -0
  75. data/spec/cassettes/Ultron_API_Comics/should_have_the_correct_first_comic.yml +2012 -0
  76. data/spec/cassettes/Ultron_API_ComicsSet/should_have_the_correct_first_comic.yml +2013 -0
  77. data/spec/cassettes/Ultron_API_Creator/it_should_have_the_correct_sets/comics.yml +2029 -0
  78. data/spec/cassettes/Ultron_API_Creator/should_have_a_comics_set.yml +2022 -0
  79. data/spec/cassettes/Ultron_API_Creator/should_have_the_correct_comic.yml +2029 -0
  80. data/spec/cassettes/Ultron_API_Creator/should_have_the_correct_name.yml +243 -0
  81. data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_comic.yml +1205 -0
  82. data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_event.yml +2778 -0
  83. data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_series.yml +4555 -0
  84. data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_story.yml +1253 -0
  85. data/spec/cassettes/Ultron_API_Creators/get_a_creator_by_name/should_return_the_correct_creator.yml +30 -0
  86. data/spec/cassettes/Ultron_API_Creators/get_the_fourth_creator_off_the_list/should_have_the_right_name.yml +1205 -0
  87. data/spec/cassettes/Ultron_API_Creators/get_the_second_creator_off_the_list/should_have_the_right_name.yml +384 -0
  88. data/spec/cassettes/Ultron_API_Creators/should_have_the_correct_first_comic.yml +32 -0
  89. data/spec/cassettes/Ultron_API_Creators/should_not_generate_a_list_of_creators_filtered_by_character.yml +31 -0
  90. data/spec/cassettes/Ultron_API_Creators/should_not_generate_lists_of_creators/filtered_by_character.yml +31 -0
  91. data/spec/cassettes/Ultron_API_Event/should_have_a_list_of_characters.yml +195 -0
  92. data/spec/cassettes/Ultron_API_Event/should_have_the_correct_first_character.yml +195 -0
  93. data/spec/cassettes/Ultron_API_Event/should_have_the_correct_title.yml +108 -0
  94. data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_character.yml +5161 -0
  95. data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_comic.yml +363 -0
  96. data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_creator.yml +9257 -0
  97. data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_series.yml +240 -0
  98. data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_story.yml +375 -0
  99. data/spec/cassettes/Ultron_API_Events/get_the_second_event_off_the_list/should_have_the_right_name.yml +4762 -0
  100. data/spec/cassettes/Ultron_API_Series/should_have_the_correct_sets/not_series.yml +40 -0
  101. data/spec/cassettes/Ultron_API_Series/should_have_the_correct_title.yml +40 -0
  102. data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_character.yml +3618 -0
  103. data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_comic.yml +31 -0
  104. data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_creator.yml +1104 -0
  105. data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_event.yml +591 -0
  106. data/spec/cassettes/Ultron_API_Serieses/get_the_third_event_off_the_list/should_have_the_right_name.yml +1780 -0
  107. data/spec/cassettes/Ultron_API_Serieses/should_not_generate_lists_of_series/filtered_by_comic.yml +31 -0
  108. data/spec/cassettes/Ultron_API_Serieses/should_not_generate_lists_of_series/filtered_by_story.yml +31 -0
  109. data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_character.yml +342 -0
  110. data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_comic.yml +110 -0
  111. data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_creator.yml +1041 -0
  112. data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_event.yml +846 -0
  113. data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_series.yml +143 -0
  114. data/spec/cassettes/Ultron_API_Stories/get_the_fourth_story_off_the_list/should_have_the_right_name.yml +686 -0
  115. data/spec/cassettes/Ultron_API_Stories/get_the_second_story_off_the_list/should_have_the_right_name.yml +686 -0
  116. data/spec/cassettes/Ultron_API_Story/should_have_the_correct_title.yml +40 -0
  117. data/spec/cassettes/Ultron_Connection/should_get_a_200.yml +559 -0
  118. data/spec/spec_helper.rb +3 -0
  119. data/spec/support/vcr_setup.rb +17 -0
  120. data/spec/ultron/api/character_spec.rb +50 -0
  121. data/spec/ultron/api/comic_spec.rb +55 -0
  122. data/spec/ultron/api/creator_spec.rb +50 -0
  123. data/spec/ultron/api/event_spec.rb +50 -0
  124. data/spec/ultron/api/filtered_sets/characters_filtered_spec.rb +53 -0
  125. data/spec/ultron/api/filtered_sets/comics_filtered_spec.rb +51 -0
  126. data/spec/ultron/api/filtered_sets/creators_filtered_spec.rb +51 -0
  127. data/spec/ultron/api/filtered_sets/events_filtered_spec.rb +51 -0
  128. data/spec/ultron/api/filtered_sets/series_filtered_spec.rb +50 -0
  129. data/spec/ultron/api/filtered_sets/stories_filtered_spec.rb +52 -0
  130. data/spec/ultron/api/series_spec.rb +46 -0
  131. data/spec/ultron/api/sets/characters_spec.rb +71 -0
  132. data/spec/ultron/api/sets/comics_spec.rb +46 -0
  133. data/spec/ultron/api/sets/creators_spec.rb +29 -0
  134. data/spec/ultron/api/sets/events_spec.rb +26 -0
  135. data/spec/ultron/api/sets/serieses_spec.rb +26 -0
  136. data/spec/ultron/api/sets/stories_spec.rb +26 -0
  137. data/spec/ultron/api/story_spec.rb +46 -0
  138. data/spec/ultron/auth_spec.rb +13 -0
  139. data/spec/ultron/config_spec.rb +16 -0
  140. data/spec/ultron/connection_spec.rb +33 -0
  141. data/spec/ultron/helpers_spec.rb +11 -0
  142. data/ultron.gemspec +16 -11
  143. metadata +346 -50
  144. data/lib/ultron/characters.rb +0 -9
  145. data/spec/ultron/characters_spec.rb +0 -12
@@ -1,8 +1,11 @@
1
1
  require 'ultron'
2
2
 
3
+ require 'timecop'
3
4
  require 'coveralls'
4
5
  Coveralls.wear_merged!
5
6
 
7
+ require_relative 'support/vcr_setup'
8
+
6
9
  RSpec.configure do |config|
7
10
  config.treat_symbols_as_metadata_keys_with_true_values = true
8
11
  config.run_all_when_everything_filtered = true
@@ -0,0 +1,17 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = 'spec/cassettes'
5
+ c.hook_into :webmock
6
+ c.default_cassette_options = { :record => :once }
7
+ c.allow_http_connections_when_no_cassette = true
8
+
9
+ [
10
+ 'PUBLIC_KEY',
11
+ 'PRIVATE_KEY'
12
+ ].each do |env_var|
13
+ c.filter_sensitive_data("<#{env_var}>") { ENV[env_var] }
14
+ end
15
+
16
+ c.configure_rspec_metadata!
17
+ end
@@ -0,0 +1,50 @@
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
@@ -0,0 +1,55 @@
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 have openstruct method-style attribute accessors', :vcr do
42
+ @comic.issueNumber.should == 67
43
+ end
44
+
45
+ it 'should give me a story' do
46
+ story = @comic.stories[0]
47
+ story.class.should == Story
48
+ end
49
+
50
+ after :each do
51
+ Timecop.return
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,50 @@
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
@@ -0,0 +1,50 @@
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
@@ -0,0 +1,53 @@
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
@@ -0,0 +1,51 @@
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
@@ -0,0 +1,51 @@
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
@@ -0,0 +1,51 @@
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