ultron 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ultron/api/entities.rb +25 -1
- data/lib/ultron/connection.rb +3 -0
- data/lib/ultron/version.rb +1 -1
- data/spec/cassettes/Ultron_API_Comics/should_give_me_a_random_comic.yml +118 -0
- data/spec/cassettes/Ultron_API_Creators/should_give_me_a_random_creator.yml +33 -0
- data/spec/cassettes/Ultron_API_Events/should_give_me_a_random_event.yml +9587 -0
- data/spec/ultron/api/sets/comics_spec.rb +7 -0
- data/spec/ultron/api/sets/creators_spec.rb +10 -3
- data/spec/ultron/api/sets/events_spec.rb +9 -0
- data/ultron.gemspec +1 -0
- metadata +22 -2
@@ -41,6 +41,13 @@ module Ultron
|
|
41
41
|
@comics[0]['title'].should == 'Wolverine (1988) #20'
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
it 'should give me a random comic', :vcr do
|
46
|
+
Comics.stub(:random_id).and_return(38207)
|
47
|
+
comic = Comics.shuffle
|
48
|
+
comic.class.should == Comic
|
49
|
+
comic['title'].should == 'The Mighty Thor (2011) #11'
|
50
|
+
end
|
44
51
|
end
|
45
52
|
end
|
46
53
|
end
|
@@ -23,9 +23,16 @@ module Ultron
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
it 'should have the correct total', :vcr do
|
27
|
+
@creators.metadata['total'].should == 5558
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should give me a random creator', :vcr do
|
31
|
+
Creators.stub(:random_id).and_return(9438)
|
32
|
+
creator = Creators.shuffle
|
33
|
+
creator.class.should == Creator
|
34
|
+
creator['fullName'].should == 'Sergio Aragones'
|
35
|
+
end
|
29
36
|
end
|
30
37
|
end
|
31
38
|
end
|
@@ -4,12 +4,14 @@ module Ultron
|
|
4
4
|
module API
|
5
5
|
describe Events do
|
6
6
|
before :each do
|
7
|
+
# Config.instance.config['debug'] = true
|
7
8
|
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
9
|
@events = Ultron::API::Events.new
|
9
10
|
end
|
10
11
|
|
11
12
|
after :each do
|
12
13
|
Timecop.return
|
14
|
+
# Config.instance.reset!
|
13
15
|
end
|
14
16
|
|
15
17
|
context 'get the second event off the list' do
|
@@ -21,6 +23,13 @@ module Ultron
|
|
21
23
|
@event['title'].should == 'Age of Apocalypse'
|
22
24
|
end
|
23
25
|
end
|
26
|
+
|
27
|
+
it 'should give me a random event', :vcr do
|
28
|
+
Events.stub(:random_id).and_return(233)
|
29
|
+
event = Events.shuffle
|
30
|
+
event.class.should == Event
|
31
|
+
event['title'].should == 'Atlantis Attacks'
|
32
|
+
end
|
24
33
|
end
|
25
34
|
end
|
26
35
|
end
|
data/ultron.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.1'
|
27
27
|
spec.add_development_dependency 'rspec', '~> 2.14'
|
28
|
+
spec.add_development_dependency 'rspec-mocks', '~> 2.14'
|
28
29
|
spec.add_development_dependency 'rspec-pride', '~> 2.3'
|
29
30
|
spec.add_development_dependency 'cucumber', '~> 1.3'
|
30
31
|
spec.add_development_dependency 'guard', '~> 2.4'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pikesley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curb
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.14'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec-mocks
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.14'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.14'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rspec-pride
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -316,6 +330,7 @@ files:
|
|
316
330
|
- spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_dateRange.yml
|
317
331
|
- spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_limit.yml
|
318
332
|
- spec/cassettes/Ultron_API_Comics/should_generate_a_list_of_comics_filtered_by_character.yml
|
333
|
+
- spec/cassettes/Ultron_API_Comics/should_give_me_a_random_comic.yml
|
319
334
|
- spec/cassettes/Ultron_API_Comics/should_have_the_correct_first_comic.yml
|
320
335
|
- spec/cassettes/Ultron_API_ComicsSet/should_have_the_correct_first_comic.yml
|
321
336
|
- spec/cassettes/Ultron_API_Creator/it_should_have_the_correct_sets/comics.yml
|
@@ -329,6 +344,7 @@ files:
|
|
329
344
|
- spec/cassettes/Ultron_API_Creators/get_a_creator_by_name/should_return_the_correct_creator.yml
|
330
345
|
- spec/cassettes/Ultron_API_Creators/get_the_fourth_creator_off_the_list/should_have_the_right_name.yml
|
331
346
|
- spec/cassettes/Ultron_API_Creators/get_the_second_creator_off_the_list/should_have_the_right_name.yml
|
347
|
+
- spec/cassettes/Ultron_API_Creators/should_give_me_a_random_creator.yml
|
332
348
|
- spec/cassettes/Ultron_API_Creators/should_have_the_correct_count.yml
|
333
349
|
- spec/cassettes/Ultron_API_Creators/should_have_the_correct_first_comic.yml
|
334
350
|
- spec/cassettes/Ultron_API_Creators/should_have_the_correct_total.yml
|
@@ -343,6 +359,7 @@ files:
|
|
343
359
|
- spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_series.yml
|
344
360
|
- spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_story.yml
|
345
361
|
- spec/cassettes/Ultron_API_Events/get_the_second_event_off_the_list/should_have_the_right_name.yml
|
362
|
+
- spec/cassettes/Ultron_API_Events/should_give_me_a_random_event.yml
|
346
363
|
- spec/cassettes/Ultron_API_Series/should_have_the_correct_sets/not_series.yml
|
347
364
|
- spec/cassettes/Ultron_API_Series/should_have_the_correct_title.yml
|
348
365
|
- spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_character.yml
|
@@ -456,6 +473,7 @@ test_files:
|
|
456
473
|
- spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_dateRange.yml
|
457
474
|
- spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_limit.yml
|
458
475
|
- spec/cassettes/Ultron_API_Comics/should_generate_a_list_of_comics_filtered_by_character.yml
|
476
|
+
- spec/cassettes/Ultron_API_Comics/should_give_me_a_random_comic.yml
|
459
477
|
- spec/cassettes/Ultron_API_Comics/should_have_the_correct_first_comic.yml
|
460
478
|
- spec/cassettes/Ultron_API_ComicsSet/should_have_the_correct_first_comic.yml
|
461
479
|
- spec/cassettes/Ultron_API_Creator/it_should_have_the_correct_sets/comics.yml
|
@@ -469,6 +487,7 @@ test_files:
|
|
469
487
|
- spec/cassettes/Ultron_API_Creators/get_a_creator_by_name/should_return_the_correct_creator.yml
|
470
488
|
- spec/cassettes/Ultron_API_Creators/get_the_fourth_creator_off_the_list/should_have_the_right_name.yml
|
471
489
|
- spec/cassettes/Ultron_API_Creators/get_the_second_creator_off_the_list/should_have_the_right_name.yml
|
490
|
+
- spec/cassettes/Ultron_API_Creators/should_give_me_a_random_creator.yml
|
472
491
|
- spec/cassettes/Ultron_API_Creators/should_have_the_correct_count.yml
|
473
492
|
- spec/cassettes/Ultron_API_Creators/should_have_the_correct_first_comic.yml
|
474
493
|
- spec/cassettes/Ultron_API_Creators/should_have_the_correct_total.yml
|
@@ -483,6 +502,7 @@ test_files:
|
|
483
502
|
- spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_series.yml
|
484
503
|
- spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_story.yml
|
485
504
|
- spec/cassettes/Ultron_API_Events/get_the_second_event_off_the_list/should_have_the_right_name.yml
|
505
|
+
- spec/cassettes/Ultron_API_Events/should_give_me_a_random_event.yml
|
486
506
|
- spec/cassettes/Ultron_API_Series/should_have_the_correct_sets/not_series.yml
|
487
507
|
- spec/cassettes/Ultron_API_Series/should_have_the_correct_title.yml
|
488
508
|
- spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_character.yml
|