taskmapper-trac 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -0,0 +1,43 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe TaskMapper::Provider::Trac::Project do
4
+
5
+ before(:all) do
6
+ @project_id = 'cored-project'
7
+ end
8
+
9
+ before(:each) do
10
+ @taskmapper = TaskMapper.new(:trac, {:username => 'cored', :password => 'afdzk', :url => 'http://trac.edgewall.org/demo-0.11'})
11
+ @klass = TaskMapper::Provider::Trac::Project
12
+ end
13
+
14
+ it "should be able to load all projects" do
15
+ @taskmapper.projects.should be_an_instance_of(Array)
16
+ @taskmapper.projects.first.should be_an_instance_of(@klass)
17
+ end
18
+
19
+ it "should be able to load all projects from an array of id's" do
20
+ @projects = @taskmapper.projects([@project_id])
21
+ @projects.should be_an_instance_of(Array)
22
+ @projects.first.should be_an_instance_of(@klass)
23
+ @projects.first.id.should == 1
24
+ end
25
+
26
+ it "should be able to load all projects from attributes" do
27
+ @projects = @taskmapper.projects(:url => 'http://trac.edgewall.org')
28
+ @projects.should be_an_instance_of(Array)
29
+ @projects.first.should be_an_instance_of(@klass)
30
+ end
31
+
32
+ it "should be able to load projects using the find method" do
33
+ @taskmapper.project.should == @klass
34
+ @taskmapper.project.find(@project_id).should be_an_instance_of(@klass)
35
+ end
36
+
37
+ it "should be able to find a project by name" do
38
+ @project = @taskmapper.project(@project_id)
39
+ @project.should be_an_instance_of(@klass)
40
+ @project.name.should == @project_id
41
+ end
42
+
43
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,11 @@
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-trac'
6
+ require 'rspec'
7
+
8
+ RSpec.configure do |config|
9
+ config.color_enabled = true
10
+ end
11
+
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "TaskMapper::Provider::Trac" do
4
+ before(:each) do
5
+ @taskmapper = TaskMapper.new(:trac, {:username => 'cored', :password => 'afdzk', :url => 'http://trac.edgewall.org/demo-0.11'})
6
+ end
7
+
8
+ it "should be able to instantiate a new instance" do
9
+ @taskmapper.should be_an_instance_of(TaskMapper)
10
+ @taskmapper.should be_a_kind_of(TaskMapper::Provider::Trac)
11
+ end
12
+
13
+ end
@@ -0,0 +1,54 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe TaskMapper::Provider::Trac::Ticket do
4
+ before(:all) do
5
+ @project_id = 'demo-0.11'
6
+ end
7
+
8
+ before(:each) do
9
+ @taskmapper = TaskMapper.new(:trac, {:url => 'http://pl3.projectlocker.com/cored/testrepo/trac', :username => 'george.rafael@gmail.com', :password => '123456'})
10
+ @project = @taskmapper.project(@project_id)
11
+ @klass = TaskMapper::Provider::Trac::Ticket
12
+ @ticket_1 = @klass.new(:summary => 'test', :status => 'open')
13
+ @tickets = [@ticket_1]
14
+ @project.stub!(:tickets).and_return(@tickets)
15
+ @project.stub!(:ticket).and_return(@ticket_1)
16
+ @project.stub!(:ticket!).and_return(@klass.new)
17
+ end
18
+
19
+ it "should be able to load all tickets" do
20
+ @project.tickets.should be_an_instance_of(Array)
21
+ @project.tickets.first.should be_an_instance_of(@klass)
22
+ end
23
+
24
+ it "should be able to load all tickets based on array of id's" do
25
+ @tickets = @project.tickets([1])
26
+ @tickets.should be_an_instance_of(Array)
27
+ @tickets.first.should be_an_instance_of(@klass)
28
+ @tickets.first.summary.should == 'test'
29
+ end
30
+
31
+ it "should be able to load all tickets using attributes" do
32
+ @tickets = @project.tickets(:status => "!closed")
33
+ @tickets.should be_an_instance_of(Array)
34
+ @tickets.first.should be_an_instance_of(@klass)
35
+ @tickets.first.summary.should == 'test'
36
+ end
37
+
38
+ it "should return the ticket class" do
39
+ @project.stub!(:ticket).and_return(@klass)
40
+ @project.ticket.should == @klass
41
+ end
42
+
43
+ it "should be able to load a single ticket based on attributes" do
44
+ @ticket = @project.ticket(:status => "!closed")
45
+ @ticket.should be_an_instance_of(@klass)
46
+ @ticket.summary.should == 'test'
47
+ end
48
+
49
+ it "should be able to create a new ticket" do
50
+ @ticket = @project.ticket!({:summary => 'Testing', :description => "Here we go"})
51
+ @ticket.should be_an_instance_of(@klass)
52
+ end
53
+
54
+ 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-trac"
8
+ s.version = "0.6.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 Your System."
14
+ s.email = "rafael@hybridgroup.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".rbenv-gemsets",
21
+ ".rvmrc",
22
+ ".travis.yml",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE",
26
+ "README.md",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "lib/provider/comment.rb",
30
+ "lib/provider/project.rb",
31
+ "lib/provider/ticket.rb",
32
+ "lib/provider/trac.rb",
33
+ "lib/taskmapper-trac.rb",
34
+ "lib/trac/trac.rb",
35
+ "spec/comments_spec.rb",
36
+ "spec/commentutil_spec.rb",
37
+ "spec/commentutils-data.html",
38
+ "spec/fixtures/tickets.xml",
39
+ "spec/projects_spec.rb",
40
+ "spec/spec.opts",
41
+ "spec/spec_helper.rb",
42
+ "spec/taskmapper-trac_spec.rb",
43
+ "spec/tickets_spec.rb",
44
+ "taskmapper-trac.gemspec"
45
+ ]
46
+ s.homepage = "http://github.com/hybridgroup/taskmapper-trac"
47
+ s.require_paths = ["lib"]
48
+ s.rubygems_version = "1.8.17"
49
+ s.summary = "taskmapper Provider for Trac"
50
+
51
+ if s.respond_to? :specification_version then
52
+ s.specification_version = 3
53
+
54
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
55
+ s.add_runtime_dependency(%q<taskmapper>, ["~> 0.8"])
56
+ s.add_runtime_dependency(%q<trac4r>, ["~> 1.2"])
57
+ s.add_runtime_dependency(%q<nokogiri>, ["~> 1.5"])
58
+ s.add_development_dependency(%q<rspec>, ["~> 2.8"])
59
+ s.add_development_dependency(%q<bundler>, ["~> 1.1"])
60
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
61
+ s.add_development_dependency(%q<simplecov>, ["~> 0.5"])
62
+ s.add_development_dependency(%q<rcov>, ["~> 1.0"])
63
+ s.add_runtime_dependency(%q<trac4r>, [">= 0"])
64
+ s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
65
+ else
66
+ s.add_dependency(%q<taskmapper>, ["~> 0.8"])
67
+ s.add_dependency(%q<trac4r>, ["~> 1.2"])
68
+ s.add_dependency(%q<nokogiri>, ["~> 1.5"])
69
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
70
+ s.add_dependency(%q<bundler>, ["~> 1.1"])
71
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
72
+ s.add_dependency(%q<simplecov>, ["~> 0.5"])
73
+ s.add_dependency(%q<rcov>, ["~> 1.0"])
74
+ s.add_dependency(%q<trac4r>, [">= 0"])
75
+ s.add_dependency(%q<nokogiri>, [">= 0"])
76
+ end
77
+ else
78
+ s.add_dependency(%q<taskmapper>, ["~> 0.8"])
79
+ s.add_dependency(%q<trac4r>, ["~> 1.2"])
80
+ s.add_dependency(%q<nokogiri>, ["~> 1.5"])
81
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
82
+ s.add_dependency(%q<bundler>, ["~> 1.1"])
83
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
84
+ s.add_dependency(%q<simplecov>, ["~> 0.5"])
85
+ s.add_dependency(%q<rcov>, ["~> 1.0"])
86
+ s.add_dependency(%q<trac4r>, [">= 0"])
87
+ s.add_dependency(%q<nokogiri>, [">= 0"])
88
+ end
89
+ end
90
+
metadata ADDED
@@ -0,0 +1,188 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: taskmapper-trac
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.6.0
6
+ platform: ruby
7
+ authors:
8
+ - Rafael George
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-05-14 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: taskmapper
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: "0.8"
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: trac4r
28
+ requirement: &id002 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: "1.2"
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: nokogiri
39
+ requirement: &id003 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: "1.5"
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: rspec
50
+ requirement: &id004 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: "2.8"
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
60
+ name: bundler
61
+ requirement: &id005 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ~>
65
+ - !ruby/object:Gem::Version
66
+ version: "1.1"
67
+ type: :development
68
+ prerelease: false
69
+ version_requirements: *id005
70
+ - !ruby/object:Gem::Dependency
71
+ name: jeweler
72
+ requirement: &id006 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: "1.6"
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: *id006
81
+ - !ruby/object:Gem::Dependency
82
+ name: simplecov
83
+ requirement: &id007 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: "0.5"
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: *id007
92
+ - !ruby/object:Gem::Dependency
93
+ name: rcov
94
+ requirement: &id008 !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ~>
98
+ - !ruby/object:Gem::Version
99
+ version: "1.0"
100
+ type: :development
101
+ prerelease: false
102
+ version_requirements: *id008
103
+ - !ruby/object:Gem::Dependency
104
+ name: trac4r
105
+ requirement: &id009 !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: "0"
111
+ type: :runtime
112
+ prerelease: false
113
+ version_requirements: *id009
114
+ - !ruby/object:Gem::Dependency
115
+ name: nokogiri
116
+ requirement: &id010 !ruby/object:Gem::Requirement
117
+ none: false
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: "0"
122
+ type: :runtime
123
+ prerelease: false
124
+ version_requirements: *id010
125
+ description: Allows taskmapper to interact with Your System.
126
+ email: rafael@hybridgroup.com
127
+ executables: []
128
+
129
+ extensions: []
130
+
131
+ extra_rdoc_files:
132
+ - LICENSE
133
+ - README.md
134
+ files:
135
+ - .rbenv-gemsets
136
+ - .rvmrc
137
+ - .travis.yml
138
+ - Gemfile
139
+ - Gemfile.lock
140
+ - LICENSE
141
+ - README.md
142
+ - Rakefile
143
+ - VERSION
144
+ - lib/provider/comment.rb
145
+ - lib/provider/project.rb
146
+ - lib/provider/ticket.rb
147
+ - lib/provider/trac.rb
148
+ - lib/taskmapper-trac.rb
149
+ - lib/trac/trac.rb
150
+ - spec/comments_spec.rb
151
+ - spec/commentutil_spec.rb
152
+ - spec/commentutils-data.html
153
+ - spec/fixtures/tickets.xml
154
+ - spec/projects_spec.rb
155
+ - spec/spec.opts
156
+ - spec/spec_helper.rb
157
+ - spec/taskmapper-trac_spec.rb
158
+ - spec/tickets_spec.rb
159
+ - taskmapper-trac.gemspec
160
+ homepage: http://github.com/hybridgroup/taskmapper-trac
161
+ licenses: []
162
+
163
+ post_install_message:
164
+ rdoc_options: []
165
+
166
+ require_paths:
167
+ - lib
168
+ required_ruby_version: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: "0"
174
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
+ none: false
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: "0"
180
+ requirements: []
181
+
182
+ rubyforge_project:
183
+ rubygems_version: 1.8.17
184
+ signing_key:
185
+ specification_version: 3
186
+ summary: taskmapper Provider for Trac
187
+ test_files: []
188
+