taskmapper-github 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/.document +5 -0
- data/.rbenv-gemsets +1 -0
- data/.rbenv-version +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +72 -0
- data/Guardfile +19 -0
- data/LICENSE +20 -0
- data/README.md +86 -0
- data/Rakefile +31 -0
- data/VERSION +1 -0
- data/lib/provider/comment.rb +91 -0
- data/lib/provider/github.rb +60 -0
- data/lib/provider/project.rb +110 -0
- data/lib/provider/ticket.rb +129 -0
- data/lib/taskmapper-github.rb +8 -0
- data/spec/comment_spec.rb +44 -0
- data/spec/fixtures/closed_issues.json +3 -0
- data/spec/fixtures/comments.json +30 -0
- data/spec/fixtures/comments/3951282.json +16 -0
- data/spec/fixtures/comments/3951282_update.json +14 -0
- data/spec/fixtures/issues.json +32 -0
- data/spec/fixtures/issues/1.json +1 -0
- data/spec/fixtures/issues/new_ticket.json +1 -0
- data/spec/fixtures/project.json +34 -0
- data/spec/fixtures/projects.json +34 -0
- data/spec/fixtures/repositories.json +1 -0
- data/spec/project_spec.rb +49 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +35 -0
- data/spec/taskmapper-github_spec.rb +28 -0
- data/spec/ticket_spec.rb +48 -0
- data/taskmapper-github.gemspec +90 -0
- metadata +157 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "TaskMapper::Provider::Github" do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@github = TaskMapper.new(:github, :login => 'cored')
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should be able to instantiate a new instance" do
|
10
|
+
@github.should be_an_instance_of(TaskMapper)
|
11
|
+
@github.should be_a_kind_of(TaskMapper::Provider::Github)
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when calling #valid?' do
|
15
|
+
it 'should test #total_private_repos number' do
|
16
|
+
user = mock 'user'
|
17
|
+
user.should_receive(:total_private_repos).and_return 0
|
18
|
+
TaskMapper::Provider::Github.api.should_receive(:user).and_return user
|
19
|
+
@github.valid?.should be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should return false when the user provides wrong credentials' do
|
23
|
+
TaskMapper::Provider::Github.api.should_receive(:user).
|
24
|
+
and_raise 'some error'
|
25
|
+
@github.valid?.should_not be_true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/spec/ticket_spec.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe TaskMapper::Provider::Github::Ticket do
|
4
|
+
before(:each) do
|
5
|
+
@github = TaskMapper.new(:github, {:login => 'taskmapper-user', :password => 'Tm123456'})
|
6
|
+
@project = @github.projects.first
|
7
|
+
@ticket_id = 1
|
8
|
+
@klass = TaskMapper::Provider::Github::Ticket
|
9
|
+
|
10
|
+
# mocking requests
|
11
|
+
stub_get('https://taskmapper-user:Tm123456@api.github.com/repos/taskmapper-user/tmtest-repo', 'project.json')
|
12
|
+
stub_get('https://taskmapper-user:Tm123456@api.github.com/repos/taskmapper-user/tmtest-repo/issues', 'issues.json')
|
13
|
+
stub_get('https://taskmapper-user:Tm123456@api.github.com/repos/taskmapper-user/tmtest-repo/issues?state=closed', 'closed_issues.json')
|
14
|
+
stub_get('https://taskmapper-user:Tm123456@github.com/api/v2/json/issues/show/taskmapper-user/tmtest-repo/1', 'issues/1.json')
|
15
|
+
stub_post('https://taskmapper-user:Tm123456@github.com/api/v2/json/issues/edit/taskmapper-user/tmtest-repo/1', 'issues/1.json')
|
16
|
+
stub_post('https://taskmapper-user:Tm123456@github.com/api/v2/json/issues/open/taskmapper-user/tmtest-repo', 'issues/new_ticket.json')
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should be able to load all tickets" do
|
20
|
+
@tickets = @project.tickets
|
21
|
+
@tickets.should be_an_instance_of(Array)
|
22
|
+
@tickets.first.should be_an_instance_of(@klass)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should be able to load tickets from an array of ids" do
|
26
|
+
@tickets = @project.tickets([@ticket_id])
|
27
|
+
@tickets.should be_an_instance_of(Array)
|
28
|
+
@tickets.first.should be_an_instance_of(@klass)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should be able to find tickets based on attributes" do
|
32
|
+
@tickets = @project.tickets(:id => @ticket_id)
|
33
|
+
@tickets.should be_an_instance_of(Array)
|
34
|
+
@tickets.first.should be_an_instance_of(@klass)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should find a ticket by id(number)" do
|
38
|
+
@ticket = @project.ticket(@ticket_id)
|
39
|
+
@ticket.should be_an_instance_of(@klass)
|
40
|
+
@ticket.title.should be_eql('for testing')
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should create a ticket" do
|
44
|
+
ticket = @project.ticket!(:title => 'new ticket', :description => 'testing')
|
45
|
+
ticket.should be_an_instance_of(@klass)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "taskmapper-github"
|
8
|
+
s.version = "0.10.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["HybridGroup"]
|
12
|
+
s.date = "2012-05-14"
|
13
|
+
s.description = "This provides an interface with github through the taskmapper gem."
|
14
|
+
s.email = "hong.quach@abigfisch.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".bundle/config",
|
21
|
+
".document",
|
22
|
+
".rbenv-gemsets",
|
23
|
+
".rbenv-version",
|
24
|
+
".travis.yml",
|
25
|
+
"Gemfile",
|
26
|
+
"Gemfile.lock",
|
27
|
+
"Guardfile",
|
28
|
+
"LICENSE",
|
29
|
+
"README.md",
|
30
|
+
"Rakefile",
|
31
|
+
"VERSION",
|
32
|
+
"lib/provider/comment.rb",
|
33
|
+
"lib/provider/github.rb",
|
34
|
+
"lib/provider/project.rb",
|
35
|
+
"lib/provider/ticket.rb",
|
36
|
+
"lib/taskmapper-github.rb",
|
37
|
+
"spec/comment_spec.rb",
|
38
|
+
"spec/fixtures/closed_issues.json",
|
39
|
+
"spec/fixtures/comments.json",
|
40
|
+
"spec/fixtures/comments/3951282.json",
|
41
|
+
"spec/fixtures/comments/3951282_update.json",
|
42
|
+
"spec/fixtures/issues.json",
|
43
|
+
"spec/fixtures/issues/1.json",
|
44
|
+
"spec/fixtures/issues/new_ticket.json",
|
45
|
+
"spec/fixtures/project.json",
|
46
|
+
"spec/fixtures/projects.json",
|
47
|
+
"spec/fixtures/repositories.json",
|
48
|
+
"spec/project_spec.rb",
|
49
|
+
"spec/spec.opts",
|
50
|
+
"spec/spec_helper.rb",
|
51
|
+
"spec/taskmapper-github_spec.rb",
|
52
|
+
"spec/ticket_spec.rb",
|
53
|
+
"taskmapper-github.gemspec"
|
54
|
+
]
|
55
|
+
s.homepage = "http://github.com/kiafaldorius/taskmapper-github"
|
56
|
+
s.require_paths = ["lib"]
|
57
|
+
s.rubygems_version = "1.8.15"
|
58
|
+
s.summary = "The github provider for taskmapper"
|
59
|
+
|
60
|
+
if s.respond_to? :specification_version then
|
61
|
+
s.specification_version = 3
|
62
|
+
|
63
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
64
|
+
s.add_runtime_dependency(%q<taskmapper>, ["~> 0.8"])
|
65
|
+
s.add_runtime_dependency(%q<octokit>, ["~> 0.6"])
|
66
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
|
67
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3"])
|
68
|
+
s.add_development_dependency(%q<fakeweb>, ["~> 1.3"])
|
69
|
+
s.add_development_dependency(%q<simplecov>, ["~> 0.5"])
|
70
|
+
s.add_development_dependency(%q<rcov>, ["~> 1.0"])
|
71
|
+
else
|
72
|
+
s.add_dependency(%q<taskmapper>, ["~> 0.8"])
|
73
|
+
s.add_dependency(%q<octokit>, ["~> 0.6"])
|
74
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6"])
|
75
|
+
s.add_dependency(%q<rspec>, ["~> 2.3"])
|
76
|
+
s.add_dependency(%q<fakeweb>, ["~> 1.3"])
|
77
|
+
s.add_dependency(%q<simplecov>, ["~> 0.5"])
|
78
|
+
s.add_dependency(%q<rcov>, ["~> 1.0"])
|
79
|
+
end
|
80
|
+
else
|
81
|
+
s.add_dependency(%q<taskmapper>, ["~> 0.8"])
|
82
|
+
s.add_dependency(%q<octokit>, ["~> 0.6"])
|
83
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6"])
|
84
|
+
s.add_dependency(%q<rspec>, ["~> 2.3"])
|
85
|
+
s.add_dependency(%q<fakeweb>, ["~> 1.3"])
|
86
|
+
s.add_dependency(%q<simplecov>, ["~> 0.5"])
|
87
|
+
s.add_dependency(%q<rcov>, ["~> 1.0"])
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
metadata
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: taskmapper-github
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.10.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- HybridGroup
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-14 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: taskmapper
|
16
|
+
requirement: &87191840 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.8'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *87191840
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: octokit
|
27
|
+
requirement: &87191540 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.6'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *87191540
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jeweler
|
38
|
+
requirement: &87191250 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.6'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *87191250
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: &87190960 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.3'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *87190960
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: fakeweb
|
60
|
+
requirement: &87190660 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '1.3'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *87190660
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: &87190380 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0.5'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *87190380
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rcov
|
82
|
+
requirement: &87190080 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ~>
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '1.0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *87190080
|
91
|
+
description: This provides an interface with github through the taskmapper gem.
|
92
|
+
email: hong.quach@abigfisch.com
|
93
|
+
executables: []
|
94
|
+
extensions: []
|
95
|
+
extra_rdoc_files:
|
96
|
+
- LICENSE
|
97
|
+
- README.md
|
98
|
+
files:
|
99
|
+
- .bundle/config
|
100
|
+
- .document
|
101
|
+
- .rbenv-gemsets
|
102
|
+
- .rbenv-version
|
103
|
+
- .travis.yml
|
104
|
+
- Gemfile
|
105
|
+
- Gemfile.lock
|
106
|
+
- Guardfile
|
107
|
+
- LICENSE
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- VERSION
|
111
|
+
- lib/provider/comment.rb
|
112
|
+
- lib/provider/github.rb
|
113
|
+
- lib/provider/project.rb
|
114
|
+
- lib/provider/ticket.rb
|
115
|
+
- lib/taskmapper-github.rb
|
116
|
+
- spec/comment_spec.rb
|
117
|
+
- spec/fixtures/closed_issues.json
|
118
|
+
- spec/fixtures/comments.json
|
119
|
+
- spec/fixtures/comments/3951282.json
|
120
|
+
- spec/fixtures/comments/3951282_update.json
|
121
|
+
- spec/fixtures/issues.json
|
122
|
+
- spec/fixtures/issues/1.json
|
123
|
+
- spec/fixtures/issues/new_ticket.json
|
124
|
+
- spec/fixtures/project.json
|
125
|
+
- spec/fixtures/projects.json
|
126
|
+
- spec/fixtures/repositories.json
|
127
|
+
- spec/project_spec.rb
|
128
|
+
- spec/spec.opts
|
129
|
+
- spec/spec_helper.rb
|
130
|
+
- spec/taskmapper-github_spec.rb
|
131
|
+
- spec/ticket_spec.rb
|
132
|
+
- taskmapper-github.gemspec
|
133
|
+
homepage: http://github.com/kiafaldorius/taskmapper-github
|
134
|
+
licenses: []
|
135
|
+
post_install_message:
|
136
|
+
rdoc_options: []
|
137
|
+
require_paths:
|
138
|
+
- lib
|
139
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
141
|
+
requirements:
|
142
|
+
- - ! '>='
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
requirements: []
|
152
|
+
rubyforge_project:
|
153
|
+
rubygems_version: 1.8.15
|
154
|
+
signing_key:
|
155
|
+
specification_version: 3
|
156
|
+
summary: The github provider for taskmapper
|
157
|
+
test_files: []
|