neweden 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "neweden"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jason Adams"]
12
- s.date = "2012-05-05"
12
+ s.date = "2012-05-14"
13
13
  s.description = "Ruby library for accessing Eve Online API"
14
14
  s.email = "jasonmadams@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -12,9 +12,9 @@ end
12
12
  require 'test/unit'
13
13
  require 'shoulda-context'
14
14
 
15
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
15
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
16
16
  $LOAD_PATH.unshift(File.dirname(__FILE__))
17
- require 'neweden'
17
+ require 'init'
18
18
 
19
19
  class Test::Unit::TestCase
20
20
  end
@@ -4,11 +4,11 @@ class TestNeweden < Test::Unit::TestCase
4
4
  context "without credentials" do
5
5
  setup do
6
6
  # set up a NewEden object with nil api values to ensure everything is defined
7
- @neweden = NewEden.new(nil, nil)
7
+ @neweden = NewEden::Connection.new(nil, nil)
8
8
  end
9
9
 
10
10
  context "a character" do
11
- NewEden::CHARACTER_ENDPOINTS.each do |endpoint|
11
+ NewEden::Connection::CHARACTER_ENDPOINTS.each do |endpoint|
12
12
  should "define method for #{endpoint} character endpoint" do
13
13
  assert @neweden.respond_to? endpoint.to_s.underscore
14
14
  end
@@ -22,12 +22,12 @@ class TestNeweden < Test::Unit::TestCase
22
22
  assert @neweden.respond_to? 'upcoming_calendar_events'
23
23
  end
24
24
  end
25
-
25
+
26
26
  context "an account" do
27
27
  should "define method for account status" do
28
28
  assert @neweden.respond_to? 'account_status'
29
29
  end
30
-
30
+
31
31
  should "define method for api key info" do
32
32
  assert @neweden.respond_to? 'api_key_info'
33
33
  end
@@ -38,7 +38,7 @@ class TestNeweden < Test::Unit::TestCase
38
38
  end
39
39
 
40
40
  context "a corporation" do
41
- NewEden::CORPORATION_ENDPOINTS.each do |endpoint|
41
+ NewEden::Connection::CORPORATION_ENDPOINTS.each do |endpoint|
42
42
  should "define method for #{endpoint} corporation endpoint" do
43
43
  assert @neweden.respond_to? "corp_#{endpoint.to_s.underscore}"
44
44
  end
@@ -46,12 +46,12 @@ class TestNeweden < Test::Unit::TestCase
46
46
  end
47
47
 
48
48
  context "general eve" do
49
- NewEden::EVE_ENDPOINTS.each do |endpoint|
49
+ NewEden::Connection::EVE_ENDPOINTS.each do |endpoint|
50
50
  should "define method for #{endpoint} eve endpoint" do
51
51
  assert @neweden.respond_to? "eve_#{endpoint.to_s.underscore}"
52
52
  end
53
53
  end
54
-
54
+
55
55
  should "define method for getting a list of character ids" do
56
56
  assert @neweden.respond_to? 'character_ids'
57
57
  end
@@ -59,14 +59,14 @@ class TestNeweden < Test::Unit::TestCase
59
59
  should "define method for getting basic character info" do
60
60
  assert @neweden.respond_to? 'character_info'
61
61
  end
62
-
62
+
63
63
  should "define method for getting character names from ids" do
64
64
  assert @neweden.respond_to? 'character_names'
65
65
  end
66
66
  end
67
67
 
68
68
  context "maps" do
69
- NewEden::MAP_ENDPOINTS.each do |endpoint|
69
+ NewEden::Connection::MAP_ENDPOINTS.each do |endpoint|
70
70
  should "define method for #{endpoint} map endpoint" do
71
71
  assert @neweden.respond_to? "map_#{endpoint.to_s.underscore}"
72
72
  end
@@ -86,7 +86,7 @@ class TestNeweden < Test::Unit::TestCase
86
86
  end
87
87
 
88
88
  context 'images' do
89
- NewEden::IMAGE_ENDPOINTS.each_pair do |endpoint, sizes|
89
+ NewEden::Connection::IMAGE_ENDPOINTS.each_pair do |endpoint, sizes|
90
90
  sizes.each do |size|
91
91
  should "define methods for getting the url for #{endpoint} of size #{size}" do
92
92
  assert @neweden.respond_to? "#{endpoint.to_s.underscore}_image_url_#{size}"
@@ -6,7 +6,8 @@ class TestNewedenLive < Test::Unit::TestCase
6
6
  setup do
7
7
  # These tests are all meant to be run against the actual API
8
8
  @config = Psych.load_file(File.join(File.dirname(__FILE__), 'config', 'eve-api.yml'))[:character]
9
- @neweden = NewEden.new(@config[:key_id], @config[:vcode])
9
+ ap @config
10
+ @neweden = NewEden::Connection.new(@config[:key_id], @config[:vcode])
10
11
  end
11
12
 
12
13
  should "have credentials present" do
@@ -14,15 +15,16 @@ class TestNewedenLive < Test::Unit::TestCase
14
15
  end
15
16
 
16
17
  context "a character" do
17
- endpoints_to_check = NewEden::CHARACTER_ENDPOINTS + ['CalendarEventAttendees', 'UpcomingCalendarEvents']
18
+ endpoints_to_check = NewEden::Connection::CHARACTER_ENDPOINTS + ['CalendarEventAttendees', 'UpcomingCalendarEvents']
18
19
  endpoints_to_check.each do |endpoint|
19
20
  next if ['NotificationTexts', 'MailBodies'].include?(endpoint)
20
21
  should "respond to #{endpoint} endpoint" do
21
22
  begin
22
23
  result = @neweden.send(endpoint.to_s.underscore, @config[:character_id])
23
24
  assert result.is_a?(Hash)
24
- assert !result.blank?
25
- rescue NewEden::NotInvolvedInFactionalWarfare
25
+ assert !result.nil?
26
+ assert !result.empty?
27
+ rescue NewEden::Connection::NotInvolvedInFactionalWarfare
26
28
  assert true
27
29
  end
28
30
  end
@@ -34,7 +36,8 @@ class TestNewedenLive < Test::Unit::TestCase
34
36
  assert true
35
37
  else
36
38
  assert result.is_a?(Hash)
37
- assert !result.blank?
39
+ assert !result.nil?
40
+ assert !result.empty?
38
41
  end
39
42
  end
40
43
  end
@@ -46,7 +49,8 @@ class TestNewedenLive < Test::Unit::TestCase
46
49
  end
47
50
 
48
51
  should "have credentials present" do
49
- assert !@config.blank?
52
+ assert !@config.nil?
53
+ assert !@config.empty?
50
54
  end
51
55
  end
52
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neweden
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-05 00:00:00.000000000 Z
12
+ date: 2012-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: typhoeus
@@ -173,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  segments:
175
175
  - 0
176
- hash: 3442815930173671628
176
+ hash: 2530693598291418128
177
177
  required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  none: false
179
179
  requirements: