gw2 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.md +1 -1
- data/README.md +4 -1
- data/gw2.gemspec +2 -2
- data/lib/gw2.rb +1 -0
- data/lib/gw2/disabled.rb +4 -0
- data/lib/gw2/event.rb +20 -5
- data/lib/gw2/guild.rb +4 -2
- data/lib/gw2/item.rb +8 -3
- data/lib/gw2/map.rb +18 -4
- data/lib/gw2/misc.rb +12 -4
- data/lib/gw2/recipe.rb +8 -3
- data/lib/gw2/wvw.rb +12 -4
- data/spec/fixtures/GW2_Event/_event_names/returns_the_names_of_all_events.yml +2060 -0
- data/spec/fixtures/GW2_Event/_map_names/returns_the_names_of_all_maps.yml +53 -0
- data/spec/fixtures/GW2_Event/_world_names/returns_the_names_of_all_worlds.yml +60 -0
- data/spec/fixtures/GW2_Guild/_details/returns_the_guild_based_on_id.yml +40 -0
- data/spec/fixtures/GW2_Guild/_details/returns_the_guild_based_on_name.yml +40 -0
- data/spec/fixtures/GW2_Item/_all/returns_all_items.yml +40 -0
- data/spec/fixtures/GW2_Item/_details/returns_the_details_of_the_item.yml +40 -0
- data/spec/fixtures/GW2_Map/_all/returns_all_maps.yml +1107 -0
- data/spec/fixtures/GW2_Map/_continents/returns_all_continents.yml +40 -0
- data/spec/fixtures/GW2_Map/_map_floor/returns_a_specific_map_floor.yml +3441 -0
- data/spec/fixtures/GW2_Map/_maps/returns_the_map_by_id.yml +41 -0
- data/spec/fixtures/GW2_Misc/_build/returns_the_build.yml +40 -0
- data/spec/fixtures/GW2_Misc/_colors/returns_all_colors.yml +239 -0
- data/spec/fixtures/GW2_Misc/_files/returns_all_files.yml +40 -0
- data/spec/fixtures/GW2_Recipe/_all/returns_all_recipes.yml +40 -0
- data/spec/fixtures/GW2_Recipe/_details/returns_the_details_of_a_recipe_by_id.yml +40 -0
- data/spec/fixtures/GW2_WvW/_match_details/returns_the_details_of_a_match.yml +40 -0
- data/spec/fixtures/GW2_WvW/_matches/returns_all_matches.yml +40 -0
- data/spec/fixtures/GW2_WvW/_objective_names/returns_all_objectives.yml +59 -0
- data/spec/gw2/event_spec.rb +66 -0
- data/spec/gw2/guild_spec.rb +33 -0
- data/spec/gw2/item_spec.rb +44 -0
- data/spec/gw2/map_spec.rb +102 -0
- data/spec/gw2/misc_spec.rb +72 -0
- data/spec/gw2/recipe_spec.rb +45 -0
- data/spec/gw2/wvw_spec.rb +55 -0
- data/spec/spec_helper.rb +10 -0
- metadata +62 -65
- data/lib/gw2/event/event_names.rb +0 -7
- data/lib/gw2/event/events.rb +0 -11
- data/lib/gw2/event/map_names.rb +0 -7
- data/lib/gw2/event/world_names.rb +0 -7
- data/lib/gw2/guild/guild_details.rb +0 -7
- data/lib/gw2/item/item_details.rb +0 -7
- data/lib/gw2/item/items.rb +0 -7
- data/lib/gw2/map/continents.rb +0 -7
- data/lib/gw2/map/map_floor.rb +0 -7
- data/lib/gw2/map/maps.rb +0 -13
- data/lib/gw2/misc/build.rb +0 -8
- data/lib/gw2/misc/colors.rb +0 -7
- data/lib/gw2/misc/files.rb +0 -7
- data/lib/gw2/recipe/recipe_details.rb +0 -7
- data/lib/gw2/recipe/recipes.rb +0 -7
- data/lib/gw2/wvw/match_details.rb +0 -7
- data/lib/gw2/wvw/matches.rb +0 -7
- data/lib/gw2/wvw/objective_names.rb +0 -7
- data/spec/event/event_names_spec.rb +0 -22
- data/spec/event/events_spec.rb +0 -55
- data/spec/event/map_names_spec.rb +0 -22
- data/spec/event/world_names_spec.rb +0 -22
- data/spec/guild/guild_details_spec.rb +0 -37
- data/spec/item/item_details_spec.rb +0 -34
- data/spec/item/items_spec.rb +0 -22
- data/spec/map/continents_spec.rb +0 -40
- data/spec/map/map_floor_spec.rb +0 -76
- data/spec/map/maps_spec.rb +0 -79
- data/spec/misc/build_spec.rb +0 -22
- data/spec/misc/colors_spec.rb +0 -51
- data/spec/misc/files_spec.rb +0 -26
- data/spec/recipe/recipe_details_spec.rb +0 -34
- data/spec/recipe/recipes_spec.rb +0 -22
- data/spec/wvw/match_details_spec.rb +0 -108
- data/spec/wvw/matches_spec.rb +0 -25
- data/spec/wvw/objective_names_spec.rb +0 -25
@@ -0,0 +1,55 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe GW2::WvW do
|
4
|
+
describe ".objective_names" do
|
5
|
+
before :each do
|
6
|
+
@objective_names = [
|
7
|
+
{"id" => "30","name" => "Tower"},
|
8
|
+
{"id" => "57","name" => "Tower"}
|
9
|
+
]
|
10
|
+
end
|
11
|
+
|
12
|
+
it "exists" do
|
13
|
+
expect(GW2::WvW.respond_to?(:objective_names)).to eq(true)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "returns all objectives", :vcr do
|
17
|
+
expect(GW2::WvW.objective_names).to include(*@objective_names)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".matches" do
|
22
|
+
before :each do
|
23
|
+
@match = {
|
24
|
+
"wvw_match_id"=>"1-6",
|
25
|
+
"red_world_id"=>1022,
|
26
|
+
"blue_world_id"=>1001,
|
27
|
+
"green_world_id"=>1007,
|
28
|
+
"start_time"=>"2015-02-21T01:00:00Z",
|
29
|
+
"end_time"=>"2015-02-28T01:00:00Z"
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
it "exists" do
|
34
|
+
expect(GW2::WvW.respond_to?(:matches)).to eq(true)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "returns all matches", :vcr do
|
38
|
+
expect(GW2::WvW.matches).to include(@match)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe ".match_details" do
|
43
|
+
before :each do
|
44
|
+
@scores = [85114, 17896, 25292]
|
45
|
+
end
|
46
|
+
|
47
|
+
it "exists" do
|
48
|
+
expect(GW2::WvW.respond_to?(:match_details)).to eq(true)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "returns the details of a match", :vcr do
|
52
|
+
expect(GW2::WvW.match_details("2-3")[0]["scores"]).to eq(@scores)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "rspec"
|
2
2
|
require "webmock/rspec"
|
3
|
+
require "vcr"
|
4
|
+
require "coveralls"
|
3
5
|
require "gw2"
|
4
6
|
|
5
7
|
RSpec.configure do |config|
|
@@ -16,3 +18,11 @@ RSpec.configure do |config|
|
|
16
18
|
# instead of true.
|
17
19
|
# config.use_transactional_fixtures = false
|
18
20
|
end
|
21
|
+
|
22
|
+
VCR.configure do |config|
|
23
|
+
config.cassette_library_dir = "spec/fixtures"
|
24
|
+
config.hook_into :webmock # or :fakeweb
|
25
|
+
config.configure_rspec_metadata!
|
26
|
+
end
|
27
|
+
|
28
|
+
Coveralls.wear!
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gw2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Rosario
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-02-26 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: A ruby gem for accessing the Guild Wars 2 API
|
15
14
|
email: c.allen.rosario@gmail.com
|
@@ -17,99 +16,97 @@ executables: []
|
|
17
16
|
extensions: []
|
18
17
|
extra_rdoc_files: []
|
19
18
|
files:
|
20
|
-
- LICENSE.md
|
21
19
|
- CHANGELOG.md
|
20
|
+
- LICENSE.md
|
22
21
|
- README.md
|
23
22
|
- gw2.gemspec
|
24
|
-
- lib/gw2
|
25
|
-
- lib/gw2/
|
26
|
-
- lib/gw2/event/map_names.rb
|
27
|
-
- lib/gw2/event/world_names.rb
|
23
|
+
- lib/gw2.rb
|
24
|
+
- lib/gw2/disabled.rb
|
28
25
|
- lib/gw2/event.rb
|
29
|
-
- lib/gw2/guild/guild_details.rb
|
30
26
|
- lib/gw2/guild.rb
|
31
27
|
- lib/gw2/https.rb
|
32
|
-
- lib/gw2/item/item_details.rb
|
33
|
-
- lib/gw2/item/items.rb
|
34
28
|
- lib/gw2/item.rb
|
35
29
|
- lib/gw2/json.rb
|
36
|
-
- lib/gw2/map/continents.rb
|
37
|
-
- lib/gw2/map/map_floor.rb
|
38
|
-
- lib/gw2/map/maps.rb
|
39
30
|
- lib/gw2/map.rb
|
40
|
-
- lib/gw2/misc/build.rb
|
41
|
-
- lib/gw2/misc/colors.rb
|
42
|
-
- lib/gw2/misc/files.rb
|
43
31
|
- lib/gw2/misc.rb
|
44
|
-
- lib/gw2/recipe/recipe_details.rb
|
45
|
-
- lib/gw2/recipe/recipes.rb
|
46
32
|
- lib/gw2/recipe.rb
|
47
|
-
- lib/gw2/wvw/match_details.rb
|
48
|
-
- lib/gw2/wvw/matches.rb
|
49
|
-
- lib/gw2/wvw/objective_names.rb
|
50
33
|
- lib/gw2/wvw.rb
|
51
|
-
-
|
52
|
-
- spec/
|
53
|
-
- spec/
|
54
|
-
- spec/
|
55
|
-
- spec/
|
56
|
-
- spec/
|
57
|
-
- spec/
|
58
|
-
- spec/
|
59
|
-
- spec/
|
60
|
-
- spec/
|
61
|
-
- spec/
|
62
|
-
- spec/
|
63
|
-
- spec/
|
64
|
-
- spec/
|
65
|
-
- spec/
|
66
|
-
- spec/
|
34
|
+
- spec/fixtures/GW2_Event/_event_names/returns_the_names_of_all_events.yml
|
35
|
+
- spec/fixtures/GW2_Event/_map_names/returns_the_names_of_all_maps.yml
|
36
|
+
- spec/fixtures/GW2_Event/_world_names/returns_the_names_of_all_worlds.yml
|
37
|
+
- spec/fixtures/GW2_Guild/_details/returns_the_guild_based_on_id.yml
|
38
|
+
- spec/fixtures/GW2_Guild/_details/returns_the_guild_based_on_name.yml
|
39
|
+
- spec/fixtures/GW2_Item/_all/returns_all_items.yml
|
40
|
+
- spec/fixtures/GW2_Item/_details/returns_the_details_of_the_item.yml
|
41
|
+
- spec/fixtures/GW2_Map/_all/returns_all_maps.yml
|
42
|
+
- spec/fixtures/GW2_Map/_continents/returns_all_continents.yml
|
43
|
+
- spec/fixtures/GW2_Map/_map_floor/returns_a_specific_map_floor.yml
|
44
|
+
- spec/fixtures/GW2_Map/_maps/returns_the_map_by_id.yml
|
45
|
+
- spec/fixtures/GW2_Misc/_build/returns_the_build.yml
|
46
|
+
- spec/fixtures/GW2_Misc/_colors/returns_all_colors.yml
|
47
|
+
- spec/fixtures/GW2_Misc/_files/returns_all_files.yml
|
48
|
+
- spec/fixtures/GW2_Recipe/_all/returns_all_recipes.yml
|
49
|
+
- spec/fixtures/GW2_Recipe/_details/returns_the_details_of_a_recipe_by_id.yml
|
50
|
+
- spec/fixtures/GW2_WvW/_match_details/returns_the_details_of_a_match.yml
|
51
|
+
- spec/fixtures/GW2_WvW/_matches/returns_all_matches.yml
|
52
|
+
- spec/fixtures/GW2_WvW/_objective_names/returns_all_objectives.yml
|
53
|
+
- spec/gw2/event_spec.rb
|
54
|
+
- spec/gw2/guild_spec.rb
|
55
|
+
- spec/gw2/item_spec.rb
|
56
|
+
- spec/gw2/map_spec.rb
|
57
|
+
- spec/gw2/misc_spec.rb
|
58
|
+
- spec/gw2/recipe_spec.rb
|
59
|
+
- spec/gw2/wvw_spec.rb
|
67
60
|
- spec/spec_helper.rb
|
68
|
-
- spec/wvw/match_details_spec.rb
|
69
|
-
- spec/wvw/matches_spec.rb
|
70
|
-
- spec/wvw/objective_names_spec.rb
|
71
61
|
homepage: https://github.com/parix/gw2
|
72
62
|
licenses:
|
73
63
|
- MIT
|
64
|
+
metadata: {}
|
74
65
|
post_install_message:
|
75
66
|
rdoc_options: []
|
76
67
|
require_paths:
|
77
68
|
- lib
|
78
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
70
|
requirements:
|
81
|
-
- -
|
71
|
+
- - ">="
|
82
72
|
- !ruby/object:Gem::Version
|
83
73
|
version: '0'
|
84
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
75
|
requirements:
|
87
|
-
- -
|
76
|
+
- - ">="
|
88
77
|
- !ruby/object:Gem::Version
|
89
78
|
version: '0'
|
90
79
|
requirements: []
|
91
80
|
rubyforge_project:
|
92
|
-
rubygems_version:
|
81
|
+
rubygems_version: 2.2.2
|
93
82
|
signing_key:
|
94
|
-
specification_version:
|
83
|
+
specification_version: 4
|
95
84
|
summary: Guild Wars 2 API
|
96
85
|
test_files:
|
97
|
-
- spec/
|
98
|
-
- spec/
|
99
|
-
- spec/
|
100
|
-
- spec/
|
101
|
-
- spec/
|
102
|
-
- spec/
|
103
|
-
- spec/
|
104
|
-
- spec/
|
105
|
-
- spec/
|
106
|
-
- spec/
|
107
|
-
- spec/
|
108
|
-
- spec/
|
109
|
-
- spec/
|
110
|
-
- spec/
|
111
|
-
- spec/
|
86
|
+
- spec/fixtures/GW2_Event/_event_names/returns_the_names_of_all_events.yml
|
87
|
+
- spec/fixtures/GW2_Event/_map_names/returns_the_names_of_all_maps.yml
|
88
|
+
- spec/fixtures/GW2_Event/_world_names/returns_the_names_of_all_worlds.yml
|
89
|
+
- spec/fixtures/GW2_Guild/_details/returns_the_guild_based_on_id.yml
|
90
|
+
- spec/fixtures/GW2_Guild/_details/returns_the_guild_based_on_name.yml
|
91
|
+
- spec/fixtures/GW2_Item/_all/returns_all_items.yml
|
92
|
+
- spec/fixtures/GW2_Item/_details/returns_the_details_of_the_item.yml
|
93
|
+
- spec/fixtures/GW2_Map/_all/returns_all_maps.yml
|
94
|
+
- spec/fixtures/GW2_Map/_continents/returns_all_continents.yml
|
95
|
+
- spec/fixtures/GW2_Map/_map_floor/returns_a_specific_map_floor.yml
|
96
|
+
- spec/fixtures/GW2_Map/_maps/returns_the_map_by_id.yml
|
97
|
+
- spec/fixtures/GW2_Misc/_build/returns_the_build.yml
|
98
|
+
- spec/fixtures/GW2_Misc/_colors/returns_all_colors.yml
|
99
|
+
- spec/fixtures/GW2_Misc/_files/returns_all_files.yml
|
100
|
+
- spec/fixtures/GW2_Recipe/_all/returns_all_recipes.yml
|
101
|
+
- spec/fixtures/GW2_Recipe/_details/returns_the_details_of_a_recipe_by_id.yml
|
102
|
+
- spec/fixtures/GW2_WvW/_match_details/returns_the_details_of_a_match.yml
|
103
|
+
- spec/fixtures/GW2_WvW/_matches/returns_all_matches.yml
|
104
|
+
- spec/fixtures/GW2_WvW/_objective_names/returns_all_objectives.yml
|
105
|
+
- spec/gw2/event_spec.rb
|
106
|
+
- spec/gw2/guild_spec.rb
|
107
|
+
- spec/gw2/item_spec.rb
|
108
|
+
- spec/gw2/map_spec.rb
|
109
|
+
- spec/gw2/misc_spec.rb
|
110
|
+
- spec/gw2/recipe_spec.rb
|
111
|
+
- spec/gw2/wvw_spec.rb
|
112
112
|
- spec/spec_helper.rb
|
113
|
-
- spec/wvw/match_details_spec.rb
|
114
|
-
- spec/wvw/matches_spec.rb
|
115
|
-
- spec/wvw/objective_names_spec.rb
|
data/lib/gw2/event/events.rb
DELETED
data/lib/gw2/event/map_names.rb
DELETED
data/lib/gw2/item/items.rb
DELETED
data/lib/gw2/map/continents.rb
DELETED
data/lib/gw2/map/map_floor.rb
DELETED
data/lib/gw2/map/maps.rb
DELETED
data/lib/gw2/misc/build.rb
DELETED
data/lib/gw2/misc/colors.rb
DELETED
data/lib/gw2/misc/files.rb
DELETED
data/lib/gw2/recipe/recipes.rb
DELETED
data/lib/gw2/wvw/matches.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe GW2::Event do
|
4
|
-
describe "methods" do
|
5
|
-
context "#event_names" do
|
6
|
-
before :each do
|
7
|
-
@event_names = %Q([{"id":"7C2B9506-5C0C-49CA-9C73-3EA740772944","name":"Skill Challenge: Fight the Quaggan Pirate"}])
|
8
|
-
|
9
|
-
stub_request(:get, "https://api.guildwars2.com/v1/event_names.json").
|
10
|
-
to_return(:status => 200, :body => @event_names)
|
11
|
-
end
|
12
|
-
|
13
|
-
it "exists" do
|
14
|
-
GW2::Event.respond_to?(:event_names).should == true
|
15
|
-
end
|
16
|
-
|
17
|
-
it "returns the correct data" do
|
18
|
-
GW2::Event.event_names.should == JSON.parse(@event_names)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|