taskmapper-fogbugz 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,38 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe TaskMapper::Provider::Fogbugz::Project do
4
+ before(:each) do
5
+ VCR.use_cassette('fogbugz') do
6
+ @taskmapper = TaskMapper.new(:fogbugz, :email => 'rafael@hybridgroup.com', :password => '1234567', :uri => 'https://ticketrb.fogbugz.com')
7
+ end
8
+ @klass = TaskMapper::Provider::Fogbugz::Project
9
+ @project_id = 2
10
+ end
11
+
12
+ it "should be able to load all projects" do
13
+ VCR.use_cassette('all-fogbugz-projects') { @projects = @taskmapper.projects }
14
+ @projects.should be_an_instance_of(Array)
15
+ @projects.first.should be_an_instance_of(@klass)
16
+ end
17
+
18
+ it "should be able to load projects from an array of ids" do
19
+ VCR.use_cassette('load-projects-by-ids') { @projects = @taskmapper.projects([@project_id]) }
20
+ @projects.should be_an_instance_of(Array)
21
+ @projects.first.should be_an_instance_of(@klass)
22
+ @projects.first.id.should == @project_id
23
+ end
24
+
25
+ it "should be able to load all projects from attributes" do
26
+ VCR.use_cassette('load-projects-attributes') { @projects = @taskmapper.projects(:id => @project_id) }
27
+ @projects.should be_an_instance_of(Array)
28
+ @projects.first.should be_an_instance_of(@klass)
29
+ @projects.first.id.should == @project_id
30
+ end
31
+
32
+ it "should be able to find a project by id" do
33
+ VCR.use_cassette('load-project-by-id') { @project = @taskmapper.project(@project_id) }
34
+ @project.should be_an_instance_of(@klass)
35
+ @project.id.should == @project_id
36
+ end
37
+
38
+ end
@@ -0,0 +1,12 @@
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-fogbugz'
6
+ require 'rspec'
7
+ require 'vcr'
8
+ require 'vcr_setup'
9
+
10
+ RSpec.configure do |config|
11
+ config.color_enabled = true
12
+ end
@@ -0,0 +1,62 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe TaskMapper::Provider::Fogbugz::Ticket do
4
+ before(:each) do
5
+ VCR.use_cassette('fogbugz') do
6
+ @taskmapper = TaskMapper.new(:fogbugz, :email => 'rafael@hybridgroup.com', :password => '1234567', :uri => 'https://ticketrb.fogbugz.com')
7
+ end
8
+ VCR.use_cassette('fogbugz-projects') { @project = @taskmapper.project(2) }
9
+ @ticket_id = 1
10
+ @klass = TaskMapper::Provider::Fogbugz::Ticket
11
+ @comment_klass = TaskMapper::Provider::Fogbugz::Comment
12
+ end
13
+
14
+ it "should be able to load all tickets" do
15
+ VCR.use_cassette('fogbugz-tickets') { @tickets = @project.tickets }
16
+ @tickets.should be_an_instance_of(Array)
17
+ @tickets.first.should be_an_instance_of(@klass)
18
+ end
19
+
20
+ it "should be able to load all tickets based on an array of ids" do
21
+ VCR.use_cassette('fogbugz-tickets-by-ids') { @tickets = @project.tickets([@ticket_id]) }
22
+ @tickets.should be_an_instance_of(Array)
23
+ @tickets.first.should be_an_instance_of(@klass)
24
+ @tickets.first.id.should == @ticket_id
25
+ end
26
+
27
+ it "should be able to load all tickets based on attributes" do
28
+ VCR.use_cassette('fogbugz-tickets-by-attributes') { @tickets = @project.tickets(:id => @ticket_id) }
29
+ @tickets.should be_an_instance_of(Array)
30
+ @tickets.first.should be_an_instance_of(@klass)
31
+ @tickets.first.id.should == @ticket_id
32
+ end
33
+
34
+ it "should be able to load a single ticket" do
35
+ VCR.use_cassette('fogbugz-single-ticket') { @ticket = @project.ticket(@ticket_id) }
36
+ @ticket.should be_an_instance_of(@klass)
37
+ @ticket.id.should == @ticket_id
38
+ end
39
+
40
+ it "should be able to create a ticket" do
41
+ ticket = nil
42
+
43
+ VCR.use_cassette('create-ticket') do
44
+ ticket = @project.ticket! :title => "Should be able to create ticket",
45
+ :priority => 2,
46
+ :assignee => 'taskmapper'
47
+ end
48
+
49
+ ticket.should be_an_instance_of(@klass)
50
+ ticket.id.should_not be_nil
51
+ ticket.project_id.should == @project.id
52
+ end
53
+
54
+ it "should be able to update a ticket" do
55
+ ticket = nil
56
+ VCR.use_cassette('fogbugz-single-ticket') { ticket = @project.ticket @ticket_id }
57
+ ticket.title = "updated"
58
+ VCR.use_cassette('update-ticket') { ticket.save.should == true }
59
+ ticket.title.should == "updated"
60
+ end
61
+
62
+ end
@@ -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 => :once }
7
+ end
@@ -0,0 +1,30 @@
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
+ require File.expand_path('../lib/version', __FILE__)
7
+
8
+ Gem::Specification.new do |gem|
9
+ gem.authors = ["Rafael George"]
10
+ gem.email = ["rafael@hybridgroup.com"]
11
+ gem.description = %q{Allows taskmapper to interact with Fogbugz.}
12
+ gem.summary = %q{Allows taskmapper to interact with Fogbugz.}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($\)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.name = "taskmapper-fogbugz"
19
+ gem.require_paths = ["lib"]
20
+ gem.version = TaskMapper::Fogbugz::VERSION
21
+
22
+ gem.add_dependency 'taskmapper', '~> 0.7'
23
+ gem.add_dependency 'rake', '~> 0.9'
24
+ gem.add_dependency 'ruby-fogbugz', '~> 0.1'
25
+
26
+ gem.add_development_dependency 'rspec', '~> 2.0'
27
+ gem.add_development_dependency 'fakeweb', '~> 1.3'
28
+ gem.add_development_dependency 'vcr', '~> 1.11'
29
+ gem.add_development_dependency 'rcov', '~> 1.0'
30
+ end
metadata ADDED
@@ -0,0 +1,218 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: taskmapper-fogbugz
3
+ version: !ruby/object:Gem::Version
4
+ hash: 15
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
+ platform: ruby
12
+ authors:
13
+ - Rafael George
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-05-11 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: taskmapper
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 5
29
+ segments:
30
+ - 0
31
+ - 7
32
+ version: "0.7"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rake
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 25
44
+ segments:
45
+ - 0
46
+ - 9
47
+ version: "0.9"
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: ruby-fogbugz
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ hash: 9
59
+ segments:
60
+ - 0
61
+ - 1
62
+ version: "0.1"
63
+ type: :runtime
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: rspec
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ hash: 3
74
+ segments:
75
+ - 2
76
+ - 0
77
+ version: "2.0"
78
+ type: :development
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: fakeweb
82
+ prerelease: false
83
+ requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ hash: 9
89
+ segments:
90
+ - 1
91
+ - 3
92
+ version: "1.3"
93
+ type: :development
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
96
+ name: vcr
97
+ prerelease: false
98
+ requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ hash: 25
104
+ segments:
105
+ - 1
106
+ - 11
107
+ version: "1.11"
108
+ type: :development
109
+ version_requirements: *id006
110
+ - !ruby/object:Gem::Dependency
111
+ name: rcov
112
+ prerelease: false
113
+ requirement: &id007 !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ~>
117
+ - !ruby/object:Gem::Version
118
+ hash: 15
119
+ segments:
120
+ - 1
121
+ - 0
122
+ version: "1.0"
123
+ type: :development
124
+ version_requirements: *id007
125
+ description: Allows taskmapper to interact with Fogbugz.
126
+ email:
127
+ - rafael@hybridgroup.com
128
+ executables: []
129
+
130
+ extensions: []
131
+
132
+ extra_rdoc_files: []
133
+
134
+ files:
135
+ - .document
136
+ - .gitignore
137
+ - .rbenv-gemsets
138
+ - .rbenv-version
139
+ - .rvmrc
140
+ - .travis.yml
141
+ - Gemfile
142
+ - Gemfile.lock
143
+ - LICENSE.txt
144
+ - README.rdoc
145
+ - Rakefile
146
+ - lib/provider/comment.rb
147
+ - lib/provider/fogbugz.rb
148
+ - lib/provider/project.rb
149
+ - lib/provider/ticket.rb
150
+ - lib/taskmapper-fogbugz.rb
151
+ - lib/version.rb
152
+ - spec/fixtures/vcr_cassettes/all-fogbugz-projects.yml
153
+ - spec/fixtures/vcr_cassettes/create-ticket.yml
154
+ - spec/fixtures/vcr_cassettes/fogbugz-projects.yml
155
+ - spec/fixtures/vcr_cassettes/fogbugz-single-ticket.yml
156
+ - spec/fixtures/vcr_cassettes/fogbugz-tickets-by-attributes.yml
157
+ - spec/fixtures/vcr_cassettes/fogbugz-tickets-by-ids.yml
158
+ - spec/fixtures/vcr_cassettes/fogbugz-tickets.yml
159
+ - spec/fixtures/vcr_cassettes/fogbugz.yml
160
+ - spec/fixtures/vcr_cassettes/load-project-by-id.yml
161
+ - spec/fixtures/vcr_cassettes/load-projects-attributes.yml
162
+ - spec/fixtures/vcr_cassettes/load-projects-by-ids.yml
163
+ - spec/fixtures/vcr_cassettes/update-ticket.yml
164
+ - spec/projects_spec.rb
165
+ - spec/spec_helper.rb
166
+ - spec/tickets_spec.rb
167
+ - spec/vcr_setup.rb
168
+ - taskmapper-fogbugz.gemspec
169
+ homepage: ""
170
+ licenses: []
171
+
172
+ post_install_message:
173
+ rdoc_options: []
174
+
175
+ require_paths:
176
+ - lib
177
+ required_ruby_version: !ruby/object:Gem::Requirement
178
+ none: false
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ hash: 3
183
+ segments:
184
+ - 0
185
+ version: "0"
186
+ required_rubygems_version: !ruby/object:Gem::Requirement
187
+ none: false
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ hash: 3
192
+ segments:
193
+ - 0
194
+ version: "0"
195
+ requirements: []
196
+
197
+ rubyforge_project:
198
+ rubygems_version: 1.8.17
199
+ signing_key:
200
+ specification_version: 3
201
+ summary: Allows taskmapper to interact with Fogbugz.
202
+ test_files:
203
+ - spec/fixtures/vcr_cassettes/all-fogbugz-projects.yml
204
+ - spec/fixtures/vcr_cassettes/create-ticket.yml
205
+ - spec/fixtures/vcr_cassettes/fogbugz-projects.yml
206
+ - spec/fixtures/vcr_cassettes/fogbugz-single-ticket.yml
207
+ - spec/fixtures/vcr_cassettes/fogbugz-tickets-by-attributes.yml
208
+ - spec/fixtures/vcr_cassettes/fogbugz-tickets-by-ids.yml
209
+ - spec/fixtures/vcr_cassettes/fogbugz-tickets.yml
210
+ - spec/fixtures/vcr_cassettes/fogbugz.yml
211
+ - spec/fixtures/vcr_cassettes/load-project-by-id.yml
212
+ - spec/fixtures/vcr_cassettes/load-projects-attributes.yml
213
+ - spec/fixtures/vcr_cassettes/load-projects-by-ids.yml
214
+ - spec/fixtures/vcr_cassettes/update-ticket.yml
215
+ - spec/projects_spec.rb
216
+ - spec/spec_helper.rb
217
+ - spec/tickets_spec.rb
218
+ - spec/vcr_setup.rb