github_api 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,8 @@ describe Github do
5
5
  before do
6
6
  subject.user = nil
7
7
  subject.repo = nil
8
+ subject.oauth_token = nil
9
+ subject.basic_auth = nil
8
10
  end
9
11
 
10
12
  it "should respond to 'new' message" do
@@ -18,8 +18,26 @@ end
18
18
  # in ./support/ and its subdirectories.
19
19
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
20
20
 
21
+ module Github
22
+ def reset!
23
+ instance_variables.each do |ivar|
24
+ instance_variable_set(ivar, nil)
25
+ end
26
+ end
27
+ end
28
+
21
29
  RSpec.configure do |config|
22
30
  config.include WebMock::API
31
+ # config.order = :rand
32
+ config.color_enabled = true
33
+ config.treat_symbols_as_metadata_keys_with_true_values = true
34
+
35
+ config.before(:each) do
36
+ WebMock.reset!
37
+ end
38
+ config.after(:each) do
39
+ WebMock.reset!
40
+ end
23
41
  end
24
42
 
25
43
  def stub_get(path, endpoint = Github.endpoint.to_s)
@@ -0,0 +1,9 @@
1
+ shared_examples_for 'unauthenticated' do
2
+ before do
3
+ reset_authentication_for github
4
+ end
5
+
6
+ after do
7
+ reset_authentication_for github
8
+ end
9
+ end
@@ -3,11 +3,16 @@ module SpecHelpers
3
3
 
4
4
  def self.included(base)
5
5
  base.class_eval do
6
- let(:github) { Github.new }
7
- let(:user) { 'peter-murach' }
8
- let(:repo) { 'github' }
9
- let(:org) { 'github' }
10
- let(:collaborator) { 'octocat' }
6
+ let!(:github) { Github.new }
7
+ let!(:user) { 'peter-murach' }
8
+ let!(:repo) { 'github' }
9
+ let!(:org) { 'github' }
10
+ let!(:collaborator) { 'octocat' }
11
+
12
+ before(:each) do
13
+ github.login = nil
14
+ github.password = nil
15
+ end
11
16
  end
12
17
  end
13
18
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: github_api
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.5
5
+ version: 0.4.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Piotr Murach
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-02-25 00:00:00 +00:00
13
+ date: 2012-02-27 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirements:
33
33
  - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: 0.7.4
35
+ version: 0.7.6
36
36
  type: :runtime
37
37
  version_requirements: *id002
38
38
  - !ruby/object:Gem::Dependency
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.3
46
+ version: 1.1.0
47
47
  type: :runtime
48
48
  version_requirements: *id003
49
49
  - !ruby/object:Gem::Dependency
@@ -54,7 +54,7 @@ dependencies:
54
54
  requirements:
55
55
  - - ~>
56
56
  - !ruby/object:Gem::Version
57
- version: 0.5.0
57
+ version: 0.5.2
58
58
  type: :runtime
59
59
  version_requirements: *id004
60
60
  - !ruby/object:Gem::Dependency
@@ -102,47 +102,47 @@ dependencies:
102
102
  type: :development
103
103
  version_requirements: *id008
104
104
  - !ruby/object:Gem::Dependency
105
- name: jeweler
105
+ name: webmock
106
106
  prerelease: false
107
107
  requirement: &id009 !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
110
- - - ">="
110
+ - - ~>
111
111
  - !ruby/object:Gem::Version
112
- version: "0"
112
+ version: 1.8.0
113
113
  type: :development
114
114
  version_requirements: *id009
115
115
  - !ruby/object:Gem::Dependency
116
- name: webmock
116
+ name: vcr
117
117
  prerelease: false
118
118
  requirement: &id010 !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
121
  - - ~>
122
122
  - !ruby/object:Gem::Version
123
- version: 1.7.6
123
+ version: 1.11.3
124
124
  type: :development
125
125
  version_requirements: *id010
126
126
  - !ruby/object:Gem::Dependency
127
- name: vcr
127
+ name: simplecov
128
128
  prerelease: false
129
129
  requirement: &id011 !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
132
132
  - - ~>
133
133
  - !ruby/object:Gem::Version
134
- version: 1.11.3
134
+ version: 0.6.1
135
135
  type: :development
136
136
  version_requirements: *id011
137
137
  - !ruby/object:Gem::Dependency
138
- name: simplecov
138
+ name: guard
139
139
  prerelease: false
140
140
  requirement: &id012 !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
143
143
  - - ~>
144
144
  - !ruby/object:Gem::Version
145
- version: "0.4"
145
+ version: 0.8.8
146
146
  type: :development
147
147
  version_requirements: *id012
148
148
  - !ruby/object:Gem::Dependency
@@ -151,9 +151,9 @@ dependencies:
151
151
  requirement: &id013 !ruby/object:Gem::Requirement
152
152
  none: false
153
153
  requirements:
154
- - - ">="
154
+ - - "="
155
155
  - !ruby/object:Gem::Version
156
- version: "0"
156
+ version: 0.5.7
157
157
  type: :development
158
158
  version_requirements: *id013
159
159
  - !ruby/object:Gem::Dependency
@@ -162,9 +162,9 @@ dependencies:
162
162
  requirement: &id014 !ruby/object:Gem::Requirement
163
163
  none: false
164
164
  requirements:
165
- - - ">="
165
+ - - "="
166
166
  - !ruby/object:Gem::Version
167
- version: "0"
167
+ version: 0.7.4
168
168
  type: :development
169
169
  version_requirements: *id014
170
170
  description: " Ruby wrapper that supports all of the GitHub API v3 methods(nearly 200). It's build in a modular way, that is, you can either instantiate the whole api wrapper Github.new or use parts of it e.i. Github::Repos.new if working solely with repositories is your main concern. "
@@ -352,6 +352,10 @@ files:
352
352
  - spec/fixtures/repos/teams.json
353
353
  - spec/fixtures/repos/watched.json
354
354
  - spec/fixtures/repos/watchers.json
355
+ - spec/fixtures/users/emails.json
356
+ - spec/fixtures/users/followers.json
357
+ - spec/fixtures/users/key.json
358
+ - spec/fixtures/users/keys.json
355
359
  - spec/fixtures/users/user.json
356
360
  - spec/github/api_factory_spec.rb
357
361
  - spec/github/api_spec.rb
@@ -405,6 +409,7 @@ files:
405
409
  - spec/github_spec.rb
406
410
  - spec/README.rdoc
407
411
  - spec/spec_helper.rb
412
+ - spec/support/authentication.rb
408
413
  - spec/support/base.rb
409
414
  - spec/support/file_ops.rb
410
415
  - spec/support/github_api_shared_examples.rb