taskmapper-bugzilla 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.rbenv-gemsets +1 -0
  2. data/.rbenv-version +1 -0
  3. data/.rvmrc +1 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +17 -0
  6. data/Gemfile.lock +56 -0
  7. data/LICENSE +22 -0
  8. data/README.md +80 -0
  9. data/Rakefile +41 -0
  10. data/VERSION +1 -0
  11. data/lib/provider/bugzilla.rb +46 -0
  12. data/lib/provider/comment.rb +69 -0
  13. data/lib/provider/project.rb +64 -0
  14. data/lib/provider/ticket.rb +118 -0
  15. data/lib/taskmapper-bugzilla.rb +35 -0
  16. data/spec/comments_spec.rb +32 -0
  17. data/spec/fixtures/vcr_cassettes/comments-all.yml +127 -0
  18. data/spec/fixtures/vcr_cassettes/comments-by-array.yml +124 -0
  19. data/spec/fixtures/vcr_cassettes/comments-by-id.yml +124 -0
  20. data/spec/fixtures/vcr_cassettes/create-a-ticket.yml +342 -0
  21. data/spec/fixtures/vcr_cassettes/init-tm-for-comments.yml +37 -0
  22. data/spec/fixtures/vcr_cassettes/load-all-projects.yml +256 -0
  23. data/spec/fixtures/vcr_cassettes/load-all-tickets.yml +271 -0
  24. data/spec/fixtures/vcr_cassettes/load-by-attributes.yml +271 -0
  25. data/spec/fixtures/vcr_cassettes/load-by-id.yml +89 -0
  26. data/spec/fixtures/vcr_cassettes/load-tickets-by-ids.yml +89 -0
  27. data/spec/fixtures/vcr_cassettes/loading-a-project.yml +38 -0
  28. data/spec/fixtures/vcr_cassettes/project-by-attributes.yml +256 -0
  29. data/spec/fixtures/vcr_cassettes/project-by-find-method.yml +42 -0
  30. data/spec/fixtures/vcr_cassettes/project-by-find-with-ids.yml +256 -0
  31. data/spec/fixtures/vcr_cassettes/project-for-comment.yml +38 -0
  32. data/spec/fixtures/vcr_cassettes/project-initialization.yml +37 -0
  33. data/spec/fixtures/vcr_cassettes/projects-by-id.yml +42 -0
  34. data/spec/fixtures/vcr_cassettes/projects-by-ids.yml +112 -0
  35. data/spec/fixtures/vcr_cassettes/taskmapper-instance.yml +37 -0
  36. data/spec/fixtures/vcr_cassettes/ticket-by-attribute.yml +35 -0
  37. data/spec/fixtures/vcr_cassettes/ticket-for-comment.yml +89 -0
  38. data/spec/fixtures/vcr_cassettes/ticketmaster-instance.yml +37 -0
  39. data/spec/fixtures/vcr_cassettes/tm-authentication.yml +37 -0
  40. data/spec/projects_spec.rb +40 -0
  41. data/spec/spec.opts +1 -0
  42. data/spec/spec_helper.rb +13 -0
  43. data/spec/taskmapper-bugzilla_spec.rb +18 -0
  44. data/spec/tickets_spec.rb +44 -0
  45. data/spec/vcr_setup.rb +7 -0
  46. data/taskmapper-bugzilla.gemspec +105 -0
  47. metadata +180 -0
@@ -0,0 +1,40 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe TaskMapper::Provider::Bugzilla::Project do
4
+
5
+ before(:all) do
6
+ @core = {:id => 1, :name => 'Core'}
7
+ @projects = [@core]
8
+ @klass = TaskMapper::Provider::Bugzilla::Project
9
+ end
10
+
11
+ before(:each) do
12
+ VCR.use_cassette('project-initialization') { @taskmapper = TaskMapper.new(:bugzilla, {:username => 'george.rafael@gmail.com', :password => '123456', :url =>'https://landfill.bugzilla.org/bugzilla-3.6-branch/'}) }
13
+ end
14
+
15
+ it "should be able to load all projects" do
16
+ VCR.use_cassette('load-all-projects') { @projects = @taskmapper.projects }
17
+ @projects.should be_an_instance_of(Array)
18
+ @projects.first.should be_an_instance_of(@klass)
19
+ end
20
+
21
+ it "should be able to load projects using an array of id's" do
22
+ VCR.use_cassette('projects-by-ids') { @projects = @taskmapper.projects([1,2,3]) }
23
+ @projects.should be_an_instance_of(Array)
24
+ @projects.first.should be_an_instance_of(@klass)
25
+ @projects.first.name.should == 'WorldControl'
26
+ end
27
+
28
+ it "should be able to find a project by id" do
29
+ VCR.use_cassette('projects-by-id') { @project = @taskmapper.project(1) }
30
+ @project.should be_an_instance_of(@klass)
31
+ @project.name.should == 'WorldControl'
32
+ end
33
+
34
+ it "should be able to load project using the find method" do
35
+ VCR.use_cassette('project-by-find-method') { @project = @taskmapper.project.find(1) }
36
+ @project.should be_an_instance_of(@klass)
37
+ @project.name.should == 'WorldControl'
38
+ end
39
+
40
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,13 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'rubygems'
4
+ require 'taskmapper'
5
+ require 'taskmapper-bugzilla'
6
+ require 'rspec'
7
+ require 'vcr'
8
+ require 'vcr_setup'
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
13
+
@@ -0,0 +1,18 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "TaskMapper::Provider::Bugzilla" do
4
+
5
+ before(:each) do
6
+ VCR.use_cassette('tm-authentication') { @taskmapper = TaskMapper.new(:bugzilla, {:username => 'george.rafael@gmail.com', :password => '123456', :url => 'https://landfill.bugzilla.org/bugzilla-3.6-branch'}) }
7
+ end
8
+
9
+ it "should be able to instantiate a new instance" do
10
+ @taskmapper.should be_an_instance_of(TaskMapper)
11
+ @taskmapper.should be_a_kind_of(TaskMapper::Provider::Bugzilla)
12
+ end
13
+
14
+ it "should be able to validate it's authentication" do
15
+ @taskmapper.valid?.should be_true
16
+ end
17
+
18
+ end
@@ -0,0 +1,44 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe TaskMapper::Provider::Bugzilla::Ticket do
4
+
5
+ before(:all) do
6
+ @klass = TaskMapper::Provider::Bugzilla::Ticket
7
+ bug = {:id => 7039}
8
+ end
9
+
10
+ before(:each) do
11
+ VCR.use_cassette('taskmapper-instance') { @taskmapper = TaskMapper.new(:bugzilla, :username => 'george.rafael@gmail.com', :password => '123456', :url =>'https://landfill.bugzilla.org/bugzilla-3.6-branch') }
12
+ VCR.use_cassette('loading-a-project') { @project = @taskmapper.project(20) }
13
+ end
14
+
15
+ it "should be able to load all tickets" do
16
+ VCR.use_cassette('load-all-tickets') { @tickets = @project.tickets }
17
+ @tickets.should be_an_instance_of(Array)
18
+ @tickets.first.should be_an_instance_of(@klass)
19
+ end
20
+
21
+ it "should be able to load all tickets from an array of id's" do
22
+ VCR.use_cassette('load-tickets-by-ids') { @tickets = @project.tickets([7039]) }
23
+ @tickets.should be_an_instance_of(Array)
24
+ @tickets.first.should be_an_instance_of(@klass)
25
+ @tickets.first.id.should == 7039
26
+ end
27
+
28
+ it "should be able to search tickets based on id attribute" do
29
+ VCR.use_cassette('load-by-attributes') { @tickets = @project.tickets(:project_id => 20) }
30
+ @tickets.should be_an_instance_of(Array)
31
+ @tickets.first.should be_an_instance_of(@klass)
32
+ end
33
+
34
+ it "should be able to search a ticket by id" do
35
+ VCR.use_cassette('load-by-id') { @ticket = @project.ticket(7039) }
36
+ @ticket.should be_an_instance_of(@klass)
37
+ @ticket.id.should == 7039
38
+ end
39
+
40
+ it "should be able to create a ticket" do
41
+ VCR.use_cassette('create-a-ticket') { @ticket = @project.ticket!(:summary => "The program crashes", :description => "It crashes", :component => "EconomicControl", :op_sys => "Linux", :platform => "x86") }
42
+ @ticket.should be_an_instance_of(@klass)
43
+ end
44
+ end
data/spec/vcr_setup.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'vcr'
2
+
3
+ VCR.config do |c|
4
+ c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
5
+ c.stub_with :fakeweb
6
+ c.default_cassette_options = { :record => :all }
7
+ end
@@ -0,0 +1,105 @@
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-bugzilla"
8
+ s.version = "0.3.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Rafael George"]
12
+ s.date = "2012-05-14"
13
+ s.description = "Allows taskmapper to interact with Bugzilla."
14
+ s.email = "rafael@hybridgroup.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".rbenv-gemsets",
21
+ ".rbenv-version",
22
+ ".rvmrc",
23
+ ".travis.yml",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "lib/provider/bugzilla.rb",
31
+ "lib/provider/comment.rb",
32
+ "lib/provider/project.rb",
33
+ "lib/provider/ticket.rb",
34
+ "lib/taskmapper-bugzilla.rb",
35
+ "spec/comments_spec.rb",
36
+ "spec/fixtures/vcr_cassettes/comments-all.yml",
37
+ "spec/fixtures/vcr_cassettes/comments-by-array.yml",
38
+ "spec/fixtures/vcr_cassettes/comments-by-id.yml",
39
+ "spec/fixtures/vcr_cassettes/create-a-ticket.yml",
40
+ "spec/fixtures/vcr_cassettes/init-tm-for-comments.yml",
41
+ "spec/fixtures/vcr_cassettes/load-all-projects.yml",
42
+ "spec/fixtures/vcr_cassettes/load-all-tickets.yml",
43
+ "spec/fixtures/vcr_cassettes/load-by-attributes.yml",
44
+ "spec/fixtures/vcr_cassettes/load-by-id.yml",
45
+ "spec/fixtures/vcr_cassettes/load-tickets-by-ids.yml",
46
+ "spec/fixtures/vcr_cassettes/loading-a-project.yml",
47
+ "spec/fixtures/vcr_cassettes/project-by-attributes.yml",
48
+ "spec/fixtures/vcr_cassettes/project-by-find-method.yml",
49
+ "spec/fixtures/vcr_cassettes/project-by-find-with-ids.yml",
50
+ "spec/fixtures/vcr_cassettes/project-for-comment.yml",
51
+ "spec/fixtures/vcr_cassettes/project-initialization.yml",
52
+ "spec/fixtures/vcr_cassettes/projects-by-id.yml",
53
+ "spec/fixtures/vcr_cassettes/projects-by-ids.yml",
54
+ "spec/fixtures/vcr_cassettes/taskmapper-instance.yml",
55
+ "spec/fixtures/vcr_cassettes/ticket-by-attribute.yml",
56
+ "spec/fixtures/vcr_cassettes/ticket-for-comment.yml",
57
+ "spec/fixtures/vcr_cassettes/ticketmaster-instance.yml",
58
+ "spec/fixtures/vcr_cassettes/tm-authentication.yml",
59
+ "spec/projects_spec.rb",
60
+ "spec/spec.opts",
61
+ "spec/spec_helper.rb",
62
+ "spec/taskmapper-bugzilla_spec.rb",
63
+ "spec/tickets_spec.rb",
64
+ "spec/vcr_setup.rb",
65
+ "taskmapper-bugzilla.gemspec"
66
+ ]
67
+ s.homepage = "http://github.com/hybridgroup/taskmapper-bugzilla"
68
+ s.require_paths = ["lib"]
69
+ s.rubygems_version = "1.8.15"
70
+ s.summary = "TaskMapper Provider for Bugzilla"
71
+
72
+ if s.respond_to? :specification_version then
73
+ s.specification_version = 3
74
+
75
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
76
+ s.add_runtime_dependency(%q<taskmapper>, ["~> 0.8"])
77
+ s.add_runtime_dependency(%q<rubyzilla>, ["~> 0.1"])
78
+ s.add_development_dependency(%q<rspec>, ["~> 2.8"])
79
+ s.add_development_dependency(%q<fakeweb>, ["~> 1.3"])
80
+ s.add_development_dependency(%q<vcr>, ["~> 1.11"])
81
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
82
+ s.add_development_dependency(%q<simplecov>, ["~> 0.5"])
83
+ s.add_development_dependency(%q<rcov>, ["~> 1.0"])
84
+ else
85
+ s.add_dependency(%q<taskmapper>, ["~> 0.8"])
86
+ s.add_dependency(%q<rubyzilla>, ["~> 0.1"])
87
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
88
+ s.add_dependency(%q<fakeweb>, ["~> 1.3"])
89
+ s.add_dependency(%q<vcr>, ["~> 1.11"])
90
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
91
+ s.add_dependency(%q<simplecov>, ["~> 0.5"])
92
+ s.add_dependency(%q<rcov>, ["~> 1.0"])
93
+ end
94
+ else
95
+ s.add_dependency(%q<taskmapper>, ["~> 0.8"])
96
+ s.add_dependency(%q<rubyzilla>, ["~> 0.1"])
97
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
98
+ s.add_dependency(%q<fakeweb>, ["~> 1.3"])
99
+ s.add_dependency(%q<vcr>, ["~> 1.11"])
100
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
101
+ s.add_dependency(%q<simplecov>, ["~> 0.5"])
102
+ s.add_dependency(%q<rcov>, ["~> 1.0"])
103
+ end
104
+ end
105
+
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: taskmapper-bugzilla
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Rafael George
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: &75618000 !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: *75618000
25
+ - !ruby/object:Gem::Dependency
26
+ name: rubyzilla
27
+ requirement: &75617750 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '0.1'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *75617750
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &75617500 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '2.8'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *75617500
47
+ - !ruby/object:Gem::Dependency
48
+ name: fakeweb
49
+ requirement: &75617260 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *75617260
58
+ - !ruby/object:Gem::Dependency
59
+ name: vcr
60
+ requirement: &75617020 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: '1.11'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *75617020
69
+ - !ruby/object:Gem::Dependency
70
+ name: jeweler
71
+ requirement: &75611900 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: '1.6'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *75611900
80
+ - !ruby/object:Gem::Dependency
81
+ name: simplecov
82
+ requirement: &75611620 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ~>
86
+ - !ruby/object:Gem::Version
87
+ version: '0.5'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *75611620
91
+ - !ruby/object:Gem::Dependency
92
+ name: rcov
93
+ requirement: &75611360 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ~>
97
+ - !ruby/object:Gem::Version
98
+ version: '1.0'
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *75611360
102
+ description: Allows taskmapper to interact with Bugzilla.
103
+ email: rafael@hybridgroup.com
104
+ executables: []
105
+ extensions: []
106
+ extra_rdoc_files:
107
+ - LICENSE
108
+ - README.md
109
+ files:
110
+ - .rbenv-gemsets
111
+ - .rbenv-version
112
+ - .rvmrc
113
+ - .travis.yml
114
+ - Gemfile
115
+ - Gemfile.lock
116
+ - LICENSE
117
+ - README.md
118
+ - Rakefile
119
+ - VERSION
120
+ - lib/provider/bugzilla.rb
121
+ - lib/provider/comment.rb
122
+ - lib/provider/project.rb
123
+ - lib/provider/ticket.rb
124
+ - lib/taskmapper-bugzilla.rb
125
+ - spec/comments_spec.rb
126
+ - spec/fixtures/vcr_cassettes/comments-all.yml
127
+ - spec/fixtures/vcr_cassettes/comments-by-array.yml
128
+ - spec/fixtures/vcr_cassettes/comments-by-id.yml
129
+ - spec/fixtures/vcr_cassettes/create-a-ticket.yml
130
+ - spec/fixtures/vcr_cassettes/init-tm-for-comments.yml
131
+ - spec/fixtures/vcr_cassettes/load-all-projects.yml
132
+ - spec/fixtures/vcr_cassettes/load-all-tickets.yml
133
+ - spec/fixtures/vcr_cassettes/load-by-attributes.yml
134
+ - spec/fixtures/vcr_cassettes/load-by-id.yml
135
+ - spec/fixtures/vcr_cassettes/load-tickets-by-ids.yml
136
+ - spec/fixtures/vcr_cassettes/loading-a-project.yml
137
+ - spec/fixtures/vcr_cassettes/project-by-attributes.yml
138
+ - spec/fixtures/vcr_cassettes/project-by-find-method.yml
139
+ - spec/fixtures/vcr_cassettes/project-by-find-with-ids.yml
140
+ - spec/fixtures/vcr_cassettes/project-for-comment.yml
141
+ - spec/fixtures/vcr_cassettes/project-initialization.yml
142
+ - spec/fixtures/vcr_cassettes/projects-by-id.yml
143
+ - spec/fixtures/vcr_cassettes/projects-by-ids.yml
144
+ - spec/fixtures/vcr_cassettes/taskmapper-instance.yml
145
+ - spec/fixtures/vcr_cassettes/ticket-by-attribute.yml
146
+ - spec/fixtures/vcr_cassettes/ticket-for-comment.yml
147
+ - spec/fixtures/vcr_cassettes/ticketmaster-instance.yml
148
+ - spec/fixtures/vcr_cassettes/tm-authentication.yml
149
+ - spec/projects_spec.rb
150
+ - spec/spec.opts
151
+ - spec/spec_helper.rb
152
+ - spec/taskmapper-bugzilla_spec.rb
153
+ - spec/tickets_spec.rb
154
+ - spec/vcr_setup.rb
155
+ - taskmapper-bugzilla.gemspec
156
+ homepage: http://github.com/hybridgroup/taskmapper-bugzilla
157
+ licenses: []
158
+ post_install_message:
159
+ rdoc_options: []
160
+ require_paths:
161
+ - lib
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - ! '>='
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ required_rubygems_version: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubyforge_project:
176
+ rubygems_version: 1.8.15
177
+ signing_key:
178
+ specification_version: 3
179
+ summary: TaskMapper Provider for Bugzilla
180
+ test_files: []