forked from piotrmurach/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_spec.rb
More file actions
39 lines (28 loc) · 1.11 KB
/
Copy pathapi_spec.rb
File metadata and controls
39 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# encoding: utf-8
require 'spec_helper'
describe Github::API do
subject { described_class.new(options) }
it { described_class.included_modules.should include Github::Authorization }
it { described_class.included_modules.should include Github::MimeType }
it { described_class.included_modules.should include Github::Request::Verbs }
context 'actions' do
let(:options) { { } }
let(:repos) { Github::Client::Repos }
it { should respond_to :api_methods_in }
it 'dynamically adds actions inspection to classes inheriting from api' do
repos.should respond_to :actions
repos.new.should respond_to :actions
end
it 'ensures output contains api methods' do
methods = [ 'method_a', 'method_b']
repos.stub(:instance_methods).and_return methods
expect(subject.api_methods_in(repos)).to eq(['method_a', 'method_b'])
end
end
context 'process_basic_auth' do
let(:options) { { :basic_auth => 'login:password' } }
its(:login) { should eq 'login' }
its(:password) { should eq 'password' }
its(:basic_auth) { should eq 'login:password' }
end
end # Github::API