marver 0.0.2 → 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/.rspec +2 -0
- data/Gemfile +2 -11
- data/README.md +50 -13
- data/TODO +3 -0
- data/lib/marver.rb +50 -40
- data/lib/marver/api.rb +8 -0
- data/lib/marver/api/client.rb +28 -0
- data/lib/marver/api/credentials.rb +21 -0
- data/lib/marver/{rest → api}/error.rb +1 -1
- data/lib/marver/{rest → api}/response.rb +1 -2
- data/lib/marver/client.rb +2 -3
- data/lib/marver/configuration.rb +10 -0
- data/lib/marver/entities/character.rb +33 -0
- data/lib/marver/entities/{core/comic.rb → comic.rb} +10 -12
- data/lib/marver/entities/commonable.rb +37 -0
- data/lib/marver/entities/{core/creator.rb → creator.rb} +10 -13
- data/lib/marver/entities/event.rb +34 -0
- data/lib/marver/entities/{common/image.rb → image.rb} +0 -0
- data/lib/marver/entities/{common/key_date.rb → key_date.rb} +0 -0
- data/lib/marver/entities/{common/price.rb → price.rb} +0 -0
- data/lib/marver/entities/queryable.rb +12 -0
- data/lib/marver/entities/serie.rb +37 -0
- data/lib/marver/entities/story.rb +33 -0
- data/lib/marver/entities/summarizable.rb +54 -0
- data/lib/marver/entities/summary.rb +10 -0
- data/lib/marver/entities/summary/character.rb +23 -0
- data/lib/marver/entities/summary/comic.rb +21 -0
- data/lib/marver/entities/summary/creator.rb +19 -0
- data/lib/marver/entities/summary/event.rb +20 -0
- data/lib/marver/entities/summary/serie.rb +19 -0
- data/lib/marver/entities/summary/story.rb +20 -0
- data/lib/marver/entities/{common/text_object.rb → text_object.rb} +0 -0
- data/lib/marver/entities/{common/url.rb → url.rb} +0 -0
- data/lib/marver/finders/character_finder.rb +2 -15
- data/lib/marver/helpers/string_helper.rb +2 -2
- data/lib/marver/version.rb +1 -1
- data/marver.gemspec +4 -0
- data/spec/marver/{rest → api}/client_spec.rb +2 -3
- data/spec/marver/api/credentials_spec.rb +17 -0
- data/spec/marver/{rest → api}/error_spec.rb +3 -3
- data/spec/marver/api/response_spec.rb +25 -0
- data/spec/marver/client_spec.rb +9 -4
- data/spec/marver/configuration_spec.rb +18 -0
- data/spec/marver/data_container_spec.rb +1 -1
- data/spec/marver/entities/{core/character_spec.rb → character_spec.rb} +11 -16
- data/spec/marver/entities/{core/comic_spec.rb → comic_spec.rb} +12 -13
- data/spec/marver/entities/{core/creator_spec.rb → creator_spec.rb} +10 -12
- data/spec/marver/entities/{core/event_spec.rb → event_spec.rb} +17 -19
- data/spec/marver/entities/{core/serie_spec.rb → serie_spec.rb} +17 -25
- data/spec/marver/entities/{core/story_spec.rb → story_spec.rb} +10 -11
- data/spec/marver/entities/{summaries/character_summary_spec.rb → summary/character_spec.rb} +7 -10
- data/spec/marver/entities/{summaries/comic_summary_spec.rb → summary/comic_spec.rb} +7 -10
- data/spec/marver/entities/summary/creator_spec.rb +63 -0
- data/spec/marver/entities/summary/event_spec.rb +60 -0
- data/spec/marver/entities/summary/serie_spec.rb +57 -0
- data/spec/marver/entities/summary/story_spec.rb +61 -0
- data/spec/marver/finders/character_finder_spec.rb +1 -10
- data/spec/spec_helper.rb +20 -1
- metadata +121 -57
- data/lib/marver/builders/common_entities_builder.rb +0 -46
- data/lib/marver/builders/core_entities_builder.rb +0 -34
- data/lib/marver/credentials.rb +0 -23
- data/lib/marver/entities/core/character.rb +0 -35
- data/lib/marver/entities/core/event.rb +0 -35
- data/lib/marver/entities/core/serie.rb +0 -37
- data/lib/marver/entities/core/story.rb +0 -36
- data/lib/marver/entities/summaries/character_summary.rb +0 -22
- data/lib/marver/entities/summaries/comic_summary.rb +0 -20
- data/lib/marver/entities/summaries/creator_summary.rb +0 -12
- data/lib/marver/entities/summaries/event_summary.rb +0 -14
- data/lib/marver/entities/summaries/serie_summary.rb +0 -13
- data/lib/marver/entities/summaries/story_summary.rb +0 -14
- data/lib/marver/rest/client.rb +0 -22
- data/spec/marver/credentials_spec.rb +0 -19
- data/spec/marver/entities/summaries/creator_summary_spec.rb +0 -23
- data/spec/marver/entities/summaries/event_summary_spec.rb +0 -30
- data/spec/marver/entities/summaries/serie_summary_spec.rb +0 -26
- data/spec/marver/entities/summaries/story_summary_spec.rb +0 -30
- data/spec/marver/rest/response_spec.rb +0 -22
@@ -1,11 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require './lib/marver.rb'
|
3
2
|
|
4
|
-
describe Marver::
|
3
|
+
describe Marver::Summary::Character do
|
5
4
|
let(:json) { JSON.parse("{ \"id\": \"123\", \"resourceURI\": \"http://gateway.marvel.com/v1/public/characters/1009351\", \"name\": \"Hulk\" }") }
|
6
|
-
let(:
|
7
|
-
let(:character_summary) { Marver::CharacterSummary.new(json,
|
8
|
-
credentials) }
|
5
|
+
let(:character_summary) { Marver::Summary::Character.new(json) }
|
9
6
|
|
10
7
|
it '#id' do
|
11
8
|
expect(character_summary.id).to eq 123
|
@@ -13,7 +10,7 @@ describe Marver::CharacterSummary do
|
|
13
10
|
|
14
11
|
it '#resource_uri' do
|
15
12
|
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
16
|
-
expect(character_summary.resource_uri).to eq "http://gateway.marvel.com/v1/public/characters/1009351
|
13
|
+
expect(character_summary.resource_uri).to eq "http://gateway.marvel.com/v1/public/characters/1009351"
|
17
14
|
end
|
18
15
|
|
19
16
|
it '#type should always be nil' do
|
@@ -39,25 +36,25 @@ describe Marver::CharacterSummary do
|
|
39
36
|
context 'summary objects' do
|
40
37
|
it 'has list of comic summaries' do
|
41
38
|
expect(@full_character.comics.class).to eq Array
|
42
|
-
expect(@full_character.comics.first.class).to eq Marver::
|
39
|
+
expect(@full_character.comics.first.class).to eq Marver::Summary::Comic
|
43
40
|
expect(@full_character.comics.first.name).to eq "Age of Apocalypse (2011) #2 (Avengers Art Appreciation Variant)"
|
44
41
|
end
|
45
42
|
|
46
43
|
it 'has a list of stories summaries' do
|
47
44
|
expect(@full_character.stories.class).to eq Array
|
48
|
-
expect(@full_character.stories.first.class).to eq Marver::
|
45
|
+
expect(@full_character.stories.first.class).to eq Marver::Summary::Story
|
49
46
|
expect(@full_character.stories.first.name).to eq "Cover #892"
|
50
47
|
end
|
51
48
|
|
52
49
|
it 'has a list of events summaries' do
|
53
50
|
expect(@full_character.events.class).to eq Array
|
54
|
-
expect(@full_character.events.first.class).to eq Marver::
|
51
|
+
expect(@full_character.events.first.class).to eq Marver::Summary::Event
|
55
52
|
expect(@full_character.events.first.name).to eq "Acts of Vengeance!"
|
56
53
|
end
|
57
54
|
|
58
55
|
it 'has a list of series summaries' do
|
59
56
|
expect(@full_character.series.class).to eq Array
|
60
|
-
expect(@full_character.series.first.class).to eq Marver::
|
57
|
+
expect(@full_character.series.first.class).to eq Marver::Summary::Serie
|
61
58
|
expect(@full_character.series.first.name).to eq "Age of Apocalypse (2011 - Present)"
|
62
59
|
end
|
63
60
|
end
|
@@ -1,10 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require './lib/marver/entities/summaries/comic_summary'
|
3
|
-
require './lib/marver/credentials'
|
4
2
|
|
5
|
-
describe Marver::
|
6
|
-
let(:
|
7
|
-
let(:comic_summary) { Marver::ComicSummary.new({ "id" => "123", "resourceURI" => "http://example.net", "name" => "Hulk" }, credentials) }
|
3
|
+
describe Marver::Summary::Comic do
|
4
|
+
let(:comic_summary) { Marver::Summary::Comic.new({ "id" => "123", "resourceURI" => "http://example.net", "name" => "Hulk" }) }
|
8
5
|
|
9
6
|
it '#id' do
|
10
7
|
expect(comic_summary.id).to eq 123
|
@@ -12,7 +9,7 @@ describe Marver::ComicSummary do
|
|
12
9
|
|
13
10
|
it '#resource_uri' do
|
14
11
|
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
15
|
-
expect(comic_summary.resource_uri).to eq "http://example.net
|
12
|
+
expect(comic_summary.resource_uri).to eq "http://example.net"
|
16
13
|
end
|
17
14
|
|
18
15
|
it '#type should always be nil' do
|
@@ -38,25 +35,25 @@ describe Marver::ComicSummary do
|
|
38
35
|
context 'summary objects' do
|
39
36
|
it 'has list of character summaries' do
|
40
37
|
expect(@full_comic.characters.class).to eq Array
|
41
|
-
expect(@full_comic.characters.first.class).to eq Marver::
|
38
|
+
expect(@full_comic.characters.first.class).to eq Marver::Summary::Character
|
42
39
|
expect(@full_comic.characters.first.name).to eq "Captain America"
|
43
40
|
end
|
44
41
|
|
45
42
|
it 'has a list of stories summaries' do
|
46
43
|
expect(@full_comic.stories.class).to eq Array
|
47
|
-
expect(@full_comic.stories.first.class).to eq Marver::
|
44
|
+
expect(@full_comic.stories.first.class).to eq Marver::Summary::Story
|
48
45
|
expect(@full_comic.stories.first.name).to eq "Age of X: Avengers (2011) #1"
|
49
46
|
end
|
50
47
|
|
51
48
|
it 'has a list of events summaries' do
|
52
49
|
expect(@full_comic.events.class).to eq Array
|
53
|
-
expect(@full_comic.events.first.class).to eq Marver::
|
50
|
+
expect(@full_comic.events.first.class).to eq Marver::Summary::Event
|
54
51
|
expect(@full_comic.events.first.name).to eq "Age of X"
|
55
52
|
end
|
56
53
|
|
57
54
|
it 'has a list of series summaries' do
|
58
55
|
expect(@full_comic.series.class).to eq Array
|
59
|
-
expect(@full_comic.series.first.class).to eq Marver::
|
56
|
+
expect(@full_comic.series.first.class).to eq Marver::Summary::Serie
|
60
57
|
expect(@full_comic.series.first.name).to eq "Age of X: Universe (2011)"
|
61
58
|
end
|
62
59
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Marver::Summary::Creator do
|
4
|
+
before :each do
|
5
|
+
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
6
|
+
@creator_summary = Marver::Summary::Creator.new({
|
7
|
+
"resourceURI" => "http://gateway.marvel.com/v1/public/creators/648", "name" => "Simone Bianchi", "role" => "penciller (cover)"
|
8
|
+
})
|
9
|
+
end
|
10
|
+
|
11
|
+
it "#name - creator's name" do
|
12
|
+
expect(@creator_summary.name).to eq "Simone Bianchi"
|
13
|
+
end
|
14
|
+
|
15
|
+
it '#resource_uri - The canonical URL identifier for this resource.' do
|
16
|
+
expect(@creator_summary.resource_uri).to eq "http://gateway.marvel.com/v1/public/creators/648"
|
17
|
+
end
|
18
|
+
|
19
|
+
it '#role - the role this creator took' do
|
20
|
+
expect(@creator_summary.role).to eq "penciller (cover)"
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#full' do
|
24
|
+
before :each do
|
25
|
+
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
26
|
+
stub_get(@creator_summary.resource_uri).to_return(:body => fixture('creator.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
27
|
+
@full_creator = @creator_summary.full
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'fetches the full view of the entity' do
|
31
|
+
expect(@full_creator.class).to eq Marver::Creator
|
32
|
+
expect(@full_creator.first_name).to eq "Simone"
|
33
|
+
expect(@full_creator.last_name).to eq "Bianchi"
|
34
|
+
expect(@full_creator.full_name).to eq "Simone Bianchi"
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'summary objects' do
|
38
|
+
it 'has list of comic summaries' do
|
39
|
+
expect(@full_creator.comics.class).to eq Array
|
40
|
+
expect(@full_creator.comics.first.class).to eq Marver::Summary::Comic
|
41
|
+
expect(@full_creator.comics.first.name).to eq "Age of X: Universe (2011) #1"
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'has a list of stories summaries' do
|
45
|
+
expect(@full_creator.stories.class).to eq Array
|
46
|
+
expect(@full_creator.stories.first.class).to eq Marver::Summary::Story
|
47
|
+
expect(@full_creator.stories.first.name).to eq "1 of 6 - Evolution"
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'has a list of series summaries' do
|
51
|
+
expect(@full_creator.series.class).to eq Array
|
52
|
+
expect(@full_creator.series.first.class).to eq Marver::Summary::Serie
|
53
|
+
expect(@full_creator.series.first.name).to eq "Age of X: Universe (2011)"
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'has a list of events summaries' do
|
57
|
+
expect(@full_creator.events.class).to eq Array
|
58
|
+
expect(@full_creator.events.first.class).to eq Marver::Summary::Event
|
59
|
+
expect(@full_creator.events.first.name).to eq "Age of X"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Marver::Summary::Event do
|
4
|
+
let(:event_summary) { Marver::Summary::Event.new({ "id" => "123", "resourceURI" => "http://example.net", "name" => "Breathing" }) }
|
5
|
+
|
6
|
+
it '#id' do
|
7
|
+
expect(event_summary.id).to eq 123
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#resource_uri' do
|
11
|
+
expect(event_summary.resource_uri).to eq "http://example.net"
|
12
|
+
end
|
13
|
+
|
14
|
+
it '#type should always be nil' do
|
15
|
+
expect(event_summary.type).to eq nil
|
16
|
+
end
|
17
|
+
|
18
|
+
it '#name' do
|
19
|
+
expect(event_summary.name).to eq "Breathing"
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#full' do
|
23
|
+
before :each do
|
24
|
+
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
25
|
+
stub_get(event_summary.resource_uri).to_return(:body => fixture('event.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
26
|
+
@full_event = event_summary.full
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'fetches the full view of the entity' do
|
30
|
+
expect(@full_event.class).to eq Marver::Event
|
31
|
+
expect(@full_event.title).to eq "Fall of the Mutants"
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'summary objects' do
|
35
|
+
it 'has list of comic summaries' do
|
36
|
+
expect(@full_event.comics.class).to eq Array
|
37
|
+
expect(@full_event.comics.first.class).to eq Marver::Summary::Comic
|
38
|
+
expect(@full_event.comics.first.name).to eq "Captain America (1968) #339"
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'has a list of stories summaries' do
|
42
|
+
expect(@full_event.stories.class).to eq Array
|
43
|
+
expect(@full_event.stories.first.class).to eq Marver::Summary::Story
|
44
|
+
expect(@full_event.stories.first.name).to eq "Fall of the Mutants"
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'has a list of series summaries' do
|
48
|
+
expect(@full_event.series.class).to eq Array
|
49
|
+
expect(@full_event.series.first.class).to eq Marver::Summary::Serie
|
50
|
+
expect(@full_event.series.first.name).to eq "Daredevil (1963 - 1998)"
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'has a list of characters summaries' do
|
54
|
+
expect(@full_event.characters.class).to eq Array
|
55
|
+
expect(@full_event.characters.first.class).to eq Marver::Summary::Character
|
56
|
+
expect(@full_event.characters.first.name).to eq "Havok"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Marver::Summary::Serie do
|
4
|
+
let(:series_summary) { Marver::Summary::Serie.new({ "resourceURI" => "http://example.net", "name" => "Hulk" }) }
|
5
|
+
|
6
|
+
it '#resource_uri' do
|
7
|
+
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
8
|
+
expect(series_summary.resource_uri).to eq "http://example.net"
|
9
|
+
end
|
10
|
+
|
11
|
+
it '#type should always be nil' do
|
12
|
+
expect(series_summary.type).to eq nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it '#name' do
|
16
|
+
expect(series_summary.name).to eq "Hulk"
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#full' do
|
20
|
+
before :each do
|
21
|
+
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
22
|
+
stub_get(series_summary.resource_uri).to_return(:body => fixture('serie.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
23
|
+
@full_serie = series_summary.full
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'fetches the full view of the entity' do
|
27
|
+
expect(@full_serie.class).to eq Marver::Serie
|
28
|
+
expect(@full_serie.title).to eq "Daredevil (1963 - 1998)"
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'summary objects' do
|
32
|
+
it 'has list of comic summaries' do
|
33
|
+
expect(@full_serie.comics.class).to eq Array
|
34
|
+
expect(@full_serie.comics.first.class).to eq Marver::Summary::Comic
|
35
|
+
expect(@full_serie.comics.first.name).to eq "Daredevil (1963)"
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'has a list of stories summaries' do
|
39
|
+
expect(@full_serie.stories.class).to eq Array
|
40
|
+
expect(@full_serie.stories.first.class).to eq Marver::Summary::Story
|
41
|
+
expect(@full_serie.stories.first.name).to eq "Life Be Not Proud!"
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'has a list of events summaries' do
|
45
|
+
expect(@full_serie.events.class).to eq Array
|
46
|
+
expect(@full_serie.events.first.class).to eq Marver::Summary::Event
|
47
|
+
expect(@full_serie.events.first.name).to eq "Acts of Vengeance!"
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'has a list of characters summaries' do
|
51
|
+
expect(@full_serie.characters.class).to eq Array
|
52
|
+
expect(@full_serie.characters.first.class).to eq Marver::Summary::Character
|
53
|
+
expect(@full_serie.characters.first.name).to eq "Beast"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Marver::Summary::Story do
|
4
|
+
let(:story_summary) { Marver::Summary::Story.new({ "id" => "123", "resourceURI" => "http://example.net", "name" => "Hulk" }) }
|
5
|
+
|
6
|
+
it '#id' do
|
7
|
+
expect(story_summary.id).to eq 123
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#resource_uri' do
|
11
|
+
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
12
|
+
expect(story_summary.resource_uri).to eq "http://example.net"
|
13
|
+
end
|
14
|
+
|
15
|
+
it '#type should always be nil' do
|
16
|
+
expect(story_summary.type).to eq nil
|
17
|
+
end
|
18
|
+
|
19
|
+
it '#name' do
|
20
|
+
expect(story_summary.name).to eq "Hulk"
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#full' do
|
24
|
+
before :each do
|
25
|
+
Time.stub_chain(:now, :to_i, :to_s).and_return "1"
|
26
|
+
stub_get(story_summary.resource_uri).to_return(:body => fixture('story.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
27
|
+
@full_story = story_summary.full
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'fetches the full view of the entity' do
|
31
|
+
expect(@full_story.class).to eq Marver::Story
|
32
|
+
expect(@full_story.title).to eq "Cover #892"
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'summary objects' do
|
36
|
+
it 'has list of comic summaries' do
|
37
|
+
expect(@full_story.comics.class).to eq Array
|
38
|
+
expect(@full_story.comics.first.class).to eq Marver::Summary::Comic
|
39
|
+
expect(@full_story.comics.first.name).to eq "Thor (1998) #81"
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'has a list of characters summaries' do
|
43
|
+
expect(@full_story.characters.class).to eq Array
|
44
|
+
expect(@full_story.characters.first.class).to eq Marver::Summary::Character
|
45
|
+
expect(@full_story.characters.first.name).to eq "Avengers"
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'has a list of series summaries' do
|
49
|
+
expect(@full_story.series.class).to eq Array
|
50
|
+
expect(@full_story.series.first.class).to eq Marver::Summary::Serie
|
51
|
+
expect(@full_story.series.first.name).to eq "Thor (1998 - 2004)"
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'has a list of events summaries' do
|
55
|
+
expect(@full_story.events.class).to eq Array
|
56
|
+
expect(@full_story.events.first.class).to eq Marver::Summary::Event
|
57
|
+
expect(@full_story.events.first.name).to eq "Avengers Disassembled"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -1,16 +1,7 @@
|
|
1
1
|
require './lib/marver/finders/character_finder.rb'
|
2
2
|
|
3
3
|
describe Marver::CharacterFinder do
|
4
|
-
let(:
|
5
|
-
let(:finder) { Marver::CharacterFinder.new(credentials) }
|
6
|
-
|
7
|
-
it 'has credentials' do
|
8
|
-
expect(finder.credentials.class).to eq Marver::Credentials
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'has a rest client' do
|
12
|
-
expect(finder.rest_client.class).to eq Marver::REST::Client
|
13
|
-
end
|
4
|
+
let(:finder) { Marver::CharacterFinder.new }
|
14
5
|
|
15
6
|
describe '#find' do
|
16
7
|
context 'no arguments' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,26 @@
|
|
1
|
+
require 'marver'
|
1
2
|
require 'json'
|
2
3
|
require 'webmock'
|
3
|
-
require './lib/marver.rb'
|
4
4
|
|
5
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
6
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
7
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
8
|
+
# loaded once.
|
9
|
+
#
|
10
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
11
|
+
RSpec.configure do |config|
|
12
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
13
|
+
config.run_all_when_everything_filtered = true
|
14
|
+
config.filter_run :focus
|
15
|
+
|
16
|
+
# Run specs in random order to surface order dependencies. If you find an
|
17
|
+
# order dependency and want to debug it, you can fix the order by providing
|
18
|
+
# the seed, which is printed after each run.
|
19
|
+
# --seed 1234
|
20
|
+
config.order = 'random'
|
21
|
+
end
|
22
|
+
|
23
|
+
# Helpers
|
5
24
|
include WebMock::API
|
6
25
|
|
7
26
|
def stub_get(path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marver
|
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
|
- Ile Eftimov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,62 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rest-client
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
41
97
|
description: Marver, Marvel's API gem
|
42
98
|
email:
|
43
99
|
- ileeftimov@gmail.com
|
@@ -46,40 +102,46 @@ extensions: []
|
|
46
102
|
extra_rdoc_files: []
|
47
103
|
files:
|
48
104
|
- .gitignore
|
105
|
+
- .rspec
|
49
106
|
- .ruby-version
|
50
107
|
- Gemfile
|
51
108
|
- Gemfile.lock
|
52
109
|
- LICENSE
|
53
110
|
- README.md
|
54
111
|
- Rakefile
|
112
|
+
- TODO
|
55
113
|
- lib/marver.rb
|
56
|
-
- lib/marver/
|
57
|
-
- lib/marver/
|
114
|
+
- lib/marver/api.rb
|
115
|
+
- lib/marver/api/client.rb
|
116
|
+
- lib/marver/api/credentials.rb
|
117
|
+
- lib/marver/api/error.rb
|
118
|
+
- lib/marver/api/response.rb
|
58
119
|
- lib/marver/client.rb
|
59
|
-
- lib/marver/
|
120
|
+
- lib/marver/configuration.rb
|
60
121
|
- lib/marver/data_container.rb
|
61
|
-
- lib/marver/entities/
|
62
|
-
- lib/marver/entities/
|
63
|
-
- lib/marver/entities/
|
64
|
-
- lib/marver/entities/
|
65
|
-
- lib/marver/entities/
|
66
|
-
- lib/marver/entities/
|
67
|
-
- lib/marver/entities/
|
68
|
-
- lib/marver/entities/
|
69
|
-
- lib/marver/entities/
|
70
|
-
- lib/marver/entities/
|
71
|
-
- lib/marver/entities/
|
72
|
-
- lib/marver/entities/
|
73
|
-
- lib/marver/entities/
|
74
|
-
- lib/marver/entities/
|
75
|
-
- lib/marver/entities/
|
76
|
-
- lib/marver/entities/
|
77
|
-
- lib/marver/entities/
|
122
|
+
- lib/marver/entities/character.rb
|
123
|
+
- lib/marver/entities/comic.rb
|
124
|
+
- lib/marver/entities/commonable.rb
|
125
|
+
- lib/marver/entities/creator.rb
|
126
|
+
- lib/marver/entities/event.rb
|
127
|
+
- lib/marver/entities/image.rb
|
128
|
+
- lib/marver/entities/key_date.rb
|
129
|
+
- lib/marver/entities/price.rb
|
130
|
+
- lib/marver/entities/queryable.rb
|
131
|
+
- lib/marver/entities/serie.rb
|
132
|
+
- lib/marver/entities/story.rb
|
133
|
+
- lib/marver/entities/summarizable.rb
|
134
|
+
- lib/marver/entities/summary.rb
|
135
|
+
- lib/marver/entities/summary/character.rb
|
136
|
+
- lib/marver/entities/summary/comic.rb
|
137
|
+
- lib/marver/entities/summary/creator.rb
|
138
|
+
- lib/marver/entities/summary/event.rb
|
139
|
+
- lib/marver/entities/summary/serie.rb
|
140
|
+
- lib/marver/entities/summary/story.rb
|
141
|
+
- lib/marver/entities/text_object.rb
|
142
|
+
- lib/marver/entities/url.rb
|
78
143
|
- lib/marver/finders/character_finder.rb
|
79
144
|
- lib/marver/helpers/string_helper.rb
|
80
|
-
- lib/marver/rest/client.rb
|
81
|
-
- lib/marver/rest/error.rb
|
82
|
-
- lib/marver/rest/response.rb
|
83
145
|
- lib/marver/version.rb
|
84
146
|
- marver.gemspec
|
85
147
|
- spec/fixtures/character.json
|
@@ -89,30 +151,31 @@ files:
|
|
89
151
|
- spec/fixtures/raw_json.json
|
90
152
|
- spec/fixtures/serie.json
|
91
153
|
- spec/fixtures/story.json
|
154
|
+
- spec/marver/api/client_spec.rb
|
155
|
+
- spec/marver/api/credentials_spec.rb
|
156
|
+
- spec/marver/api/error_spec.rb
|
157
|
+
- spec/marver/api/response_spec.rb
|
92
158
|
- spec/marver/client_spec.rb
|
93
|
-
- spec/marver/
|
159
|
+
- spec/marver/configuration_spec.rb
|
94
160
|
- spec/marver/data_container_spec.rb
|
95
|
-
- spec/marver/entities/
|
96
|
-
- spec/marver/entities/
|
97
|
-
- spec/marver/entities/
|
98
|
-
- spec/marver/entities/
|
99
|
-
- spec/marver/entities/core/serie_spec.rb
|
100
|
-
- spec/marver/entities/core/story_spec.rb
|
161
|
+
- spec/marver/entities/character_spec.rb
|
162
|
+
- spec/marver/entities/comic_spec.rb
|
163
|
+
- spec/marver/entities/creator_spec.rb
|
164
|
+
- spec/marver/entities/event_spec.rb
|
101
165
|
- spec/marver/entities/image_spec.rb
|
102
166
|
- spec/marver/entities/key_date_spec.rb
|
103
167
|
- spec/marver/entities/price_spec.rb
|
104
|
-
- spec/marver/entities/
|
105
|
-
- spec/marver/entities/
|
106
|
-
- spec/marver/entities/
|
107
|
-
- spec/marver/entities/
|
108
|
-
- spec/marver/entities/
|
109
|
-
- spec/marver/entities/
|
168
|
+
- spec/marver/entities/serie_spec.rb
|
169
|
+
- spec/marver/entities/story_spec.rb
|
170
|
+
- spec/marver/entities/summary/character_spec.rb
|
171
|
+
- spec/marver/entities/summary/comic_spec.rb
|
172
|
+
- spec/marver/entities/summary/creator_spec.rb
|
173
|
+
- spec/marver/entities/summary/event_spec.rb
|
174
|
+
- spec/marver/entities/summary/serie_spec.rb
|
175
|
+
- spec/marver/entities/summary/story_spec.rb
|
110
176
|
- spec/marver/entities/text_object_spec.rb
|
111
177
|
- spec/marver/entities/url_spec.rb
|
112
178
|
- spec/marver/finders/character_finder_spec.rb
|
113
|
-
- spec/marver/rest/client_spec.rb
|
114
|
-
- spec/marver/rest/error_spec.rb
|
115
|
-
- spec/marver/rest/response_spec.rb
|
116
179
|
- spec/spec_helper.rb
|
117
180
|
homepage: ''
|
118
181
|
licenses:
|
@@ -146,28 +209,29 @@ test_files:
|
|
146
209
|
- spec/fixtures/raw_json.json
|
147
210
|
- spec/fixtures/serie.json
|
148
211
|
- spec/fixtures/story.json
|
212
|
+
- spec/marver/api/client_spec.rb
|
213
|
+
- spec/marver/api/credentials_spec.rb
|
214
|
+
- spec/marver/api/error_spec.rb
|
215
|
+
- spec/marver/api/response_spec.rb
|
149
216
|
- spec/marver/client_spec.rb
|
150
|
-
- spec/marver/
|
217
|
+
- spec/marver/configuration_spec.rb
|
151
218
|
- spec/marver/data_container_spec.rb
|
152
|
-
- spec/marver/entities/
|
153
|
-
- spec/marver/entities/
|
154
|
-
- spec/marver/entities/
|
155
|
-
- spec/marver/entities/
|
156
|
-
- spec/marver/entities/core/serie_spec.rb
|
157
|
-
- spec/marver/entities/core/story_spec.rb
|
219
|
+
- spec/marver/entities/character_spec.rb
|
220
|
+
- spec/marver/entities/comic_spec.rb
|
221
|
+
- spec/marver/entities/creator_spec.rb
|
222
|
+
- spec/marver/entities/event_spec.rb
|
158
223
|
- spec/marver/entities/image_spec.rb
|
159
224
|
- spec/marver/entities/key_date_spec.rb
|
160
225
|
- spec/marver/entities/price_spec.rb
|
161
|
-
- spec/marver/entities/
|
162
|
-
- spec/marver/entities/
|
163
|
-
- spec/marver/entities/
|
164
|
-
- spec/marver/entities/
|
165
|
-
- spec/marver/entities/
|
166
|
-
- spec/marver/entities/
|
226
|
+
- spec/marver/entities/serie_spec.rb
|
227
|
+
- spec/marver/entities/story_spec.rb
|
228
|
+
- spec/marver/entities/summary/character_spec.rb
|
229
|
+
- spec/marver/entities/summary/comic_spec.rb
|
230
|
+
- spec/marver/entities/summary/creator_spec.rb
|
231
|
+
- spec/marver/entities/summary/event_spec.rb
|
232
|
+
- spec/marver/entities/summary/serie_spec.rb
|
233
|
+
- spec/marver/entities/summary/story_spec.rb
|
167
234
|
- spec/marver/entities/text_object_spec.rb
|
168
235
|
- spec/marver/entities/url_spec.rb
|
169
236
|
- spec/marver/finders/character_finder_spec.rb
|
170
|
-
- spec/marver/rest/client_spec.rb
|
171
|
-
- spec/marver/rest/error_spec.rb
|
172
|
-
- spec/marver/rest/response_spec.rb
|
173
237
|
- spec/spec_helper.rb
|