bugherd-api 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +40 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +26 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/bugherd-api.gemspec +84 -0
- data/lib/bugherd-api.rb +1 -0
- data/lib/bugherd.rb +27 -0
- data/lib/bugherd/.project.rb.swp +0 -0
- data/lib/bugherd/base.rb +11 -0
- data/lib/bugherd/project.rb +4 -0
- data/lib/bugherd/task.rb +5 -0
- data/lib/bugherd/user.rb +4 -0
- data/spec/.project_spec.rb.swp +0 -0
- data/spec/bugherd-api_spec.rb +11 -0
- data/spec/fixtures/.projects.xml.swp +0 -0
- data/spec/fixtures/projects.xml +13 -0
- data/spec/fixtures/projects/.1458.xml.swp +0 -0
- data/spec/fixtures/projects/1458.xml +14 -0
- data/spec/fixtures/tasks.xml +25 -0
- data/spec/fixtures/tasks/4950.xml +16 -0
- data/spec/fixtures/users.xml +9 -0
- data/spec/project_spec.rb +35 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/task_spec.rb +34 -0
- data/spec/user_spec.rb +23 -0
- metadata +185 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
gem "activesupport"
|
5
|
+
gem "activeresource"
|
6
|
+
|
7
|
+
# Add dependencies to develop your gem here.
|
8
|
+
# Include everything needed to run rake, tests, features, etc.
|
9
|
+
group :development do
|
10
|
+
gem "rspec", "~> 2.3.0"
|
11
|
+
gem "bundler", "~> 1.0.0"
|
12
|
+
gem "jeweler", "~> 1.6.4"
|
13
|
+
gem "rcov", ">= 0"
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activemodel (3.0.9)
|
5
|
+
activesupport (= 3.0.9)
|
6
|
+
builder (~> 2.1.2)
|
7
|
+
i18n (~> 0.5.0)
|
8
|
+
activeresource (3.0.9)
|
9
|
+
activemodel (= 3.0.9)
|
10
|
+
activesupport (= 3.0.9)
|
11
|
+
activesupport (3.0.9)
|
12
|
+
builder (2.1.2)
|
13
|
+
diff-lcs (1.1.2)
|
14
|
+
git (1.2.5)
|
15
|
+
i18n (0.5.0)
|
16
|
+
jeweler (1.6.4)
|
17
|
+
bundler (~> 1.0)
|
18
|
+
git (>= 1.2.5)
|
19
|
+
rake
|
20
|
+
rake (0.9.2)
|
21
|
+
rcov (0.9.10)
|
22
|
+
rspec (2.3.0)
|
23
|
+
rspec-core (~> 2.3.0)
|
24
|
+
rspec-expectations (~> 2.3.0)
|
25
|
+
rspec-mocks (~> 2.3.0)
|
26
|
+
rspec-core (2.3.1)
|
27
|
+
rspec-expectations (2.3.0)
|
28
|
+
diff-lcs (~> 1.1.2)
|
29
|
+
rspec-mocks (2.3.0)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
x86-mingw32
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
activeresource
|
36
|
+
activesupport
|
37
|
+
bundler (~> 1.0.0)
|
38
|
+
jeweler (~> 1.6.4)
|
39
|
+
rcov
|
40
|
+
rspec (~> 2.3.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Rafael George
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
= bugherd-api
|
2
|
+
|
3
|
+
Ruby library for interacting with Bugherd API[http://www.bugherd.com/api]
|
4
|
+
|
5
|
+
== Documentation and Dependencies
|
6
|
+
|
7
|
+
* ActiveResource
|
8
|
+
* ActiveSupport
|
9
|
+
|
10
|
+
== Examples (Comming Soon)
|
11
|
+
|
12
|
+
== Contributing to bugherd-api
|
13
|
+
|
14
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
15
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
16
|
+
* Fork the project
|
17
|
+
* Start a feature/bugfix branch
|
18
|
+
* Commit and push until you are happy with your contribution
|
19
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
20
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
21
|
+
|
22
|
+
== Copyright
|
23
|
+
|
24
|
+
Copyright (c) 2011 Rafael George. See LICENSE.txt for
|
25
|
+
further details.
|
26
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "bugherd-api"
|
18
|
+
gem.homepage = "http://github.com/cored/bugherd-api"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{BugherdAPI wrapper}
|
21
|
+
gem.description = %Q{BugherdAPI wrapper}
|
22
|
+
gem.email = "george.rafael@gmail.com"
|
23
|
+
gem.authors = ["Rafael George"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rake/rdoctask'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "bugherd-api #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/bugherd-api.gemspec
ADDED
@@ -0,0 +1,84 @@
|
|
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 = %q{bugherd-api}
|
8
|
+
s.version = "0.0.1"
|
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 = %q{2011-08-23}
|
13
|
+
s.description = %q{BugherdAPI wrapper}
|
14
|
+
s.email = %q{george.rafael@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bugherd-api.gemspec",
|
29
|
+
"lib/bugherd-api.rb",
|
30
|
+
"lib/bugherd.rb",
|
31
|
+
"lib/bugherd/.project.rb.swp",
|
32
|
+
"lib/bugherd/base.rb",
|
33
|
+
"lib/bugherd/project.rb",
|
34
|
+
"lib/bugherd/task.rb",
|
35
|
+
"lib/bugherd/user.rb",
|
36
|
+
"spec/.project_spec.rb.swp",
|
37
|
+
"spec/bugherd-api_spec.rb",
|
38
|
+
"spec/fixtures/.projects.xml.swp",
|
39
|
+
"spec/fixtures/projects.xml",
|
40
|
+
"spec/fixtures/projects/.1458.xml.swp",
|
41
|
+
"spec/fixtures/projects/1458.xml",
|
42
|
+
"spec/fixtures/tasks.xml",
|
43
|
+
"spec/fixtures/tasks/4950.xml",
|
44
|
+
"spec/fixtures/users.xml",
|
45
|
+
"spec/project_spec.rb",
|
46
|
+
"spec/spec_helper.rb",
|
47
|
+
"spec/task_spec.rb",
|
48
|
+
"spec/user_spec.rb"
|
49
|
+
]
|
50
|
+
s.homepage = %q{http://github.com/cored/bugherd-api}
|
51
|
+
s.licenses = ["MIT"]
|
52
|
+
s.require_paths = ["lib"]
|
53
|
+
s.rubygems_version = %q{1.3.7}
|
54
|
+
s.summary = %q{BugherdAPI wrapper}
|
55
|
+
|
56
|
+
if s.respond_to? :specification_version then
|
57
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
58
|
+
s.specification_version = 3
|
59
|
+
|
60
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
62
|
+
s.add_runtime_dependency(%q<activeresource>, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
64
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
65
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
66
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
67
|
+
else
|
68
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
69
|
+
s.add_dependency(%q<activeresource>, [">= 0"])
|
70
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
71
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
72
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
73
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
74
|
+
end
|
75
|
+
else
|
76
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
77
|
+
s.add_dependency(%q<activeresource>, [">= 0"])
|
78
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
79
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
80
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
81
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
data/lib/bugherd-api.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'bugherd')
|
data/lib/bugherd.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
$: << File.dirname(__FILE__) unless $:.include?(File.dirname(__FILE__))
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'active_support'
|
5
|
+
require 'active_resource'
|
6
|
+
|
7
|
+
module BugherdAPI
|
8
|
+
extend ActiveSupport::Autoload
|
9
|
+
|
10
|
+
autoload :Base, 'bugherd/base'
|
11
|
+
autoload :User, 'bugherd/user'
|
12
|
+
autoload :Project, 'bugherd/project'
|
13
|
+
autoload :Task, 'bugherd/task'
|
14
|
+
class Error < StandardError; end
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def authenticate(email, password)
|
18
|
+
@email = email
|
19
|
+
@password = password
|
20
|
+
end
|
21
|
+
|
22
|
+
def resources
|
23
|
+
@resources ||= []
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
Binary file
|
data/lib/bugherd/base.rb
ADDED
data/lib/bugherd/task.rb
ADDED
data/lib/bugherd/user.rb
ADDED
Binary file
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "BugherdApi" do
|
4
|
+
|
5
|
+
context "Authentication" do
|
6
|
+
it "should authenticate with Bugherd server" do
|
7
|
+
bugherd = BugherdAPI.authenticate('user@email.com', '123456')
|
8
|
+
bugherd.should_not be_nil
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projects type="array">
|
3
|
+
<project>
|
4
|
+
<id type="integer">1458</id>
|
5
|
+
<name>clutchapptest</name>
|
6
|
+
<devurl>http://clutchapptest.ticketmaster.com</devurl>
|
7
|
+
</project>
|
8
|
+
<project>
|
9
|
+
<id type="integer">1487</id>
|
10
|
+
<name>testing</name>
|
11
|
+
<devurl>yeah.com</devurl>
|
12
|
+
</project>
|
13
|
+
</projects>
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project>
|
3
|
+
<id type="integer">1458</id>
|
4
|
+
<name>clutchapptest</name>
|
5
|
+
<devurl>http://clutchapptest.ticketmaster.com</devurl>
|
6
|
+
<users type="array">
|
7
|
+
<user>
|
8
|
+
<id type="integer">1798</id>
|
9
|
+
<email>george.rafael@gmail.com</email>
|
10
|
+
<name>Rafael</name>
|
11
|
+
<surname>George</surname>
|
12
|
+
</user>
|
13
|
+
</users>
|
14
|
+
</project>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<tasks type="array">
|
3
|
+
<task>
|
4
|
+
<id type="integer">5019</id>
|
5
|
+
<description>Should return nil withou asignee
|
6
|
+
</description>
|
7
|
+
<status-id type="integer">0</status-id>
|
8
|
+
<priority-id type="integer" nil="true"></priority-id>
|
9
|
+
<assigned-to-id type="integer" nil="true"></assigned-to-id>
|
10
|
+
</task>
|
11
|
+
<task>
|
12
|
+
<id type="integer">4950</id>
|
13
|
+
<description>Now this one should be green not red</description>
|
14
|
+
<status-id type="integer">2</status-id>
|
15
|
+
<priority-id type="integer" nil="true"></priority-id>
|
16
|
+
<assigned-to-id type="integer">1798</assigned-to-id>
|
17
|
+
</task>
|
18
|
+
<task>
|
19
|
+
<id type="integer">4949</id>
|
20
|
+
<description>This button should use another color</description>
|
21
|
+
<status-id type="integer">2</status-id>
|
22
|
+
<priority-id type="integer" nil="true"></priority-id>
|
23
|
+
<assigned-to-id type="integer">1798</assigned-to-id>
|
24
|
+
</task>
|
25
|
+
</tasks>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<task>
|
3
|
+
<id type="integer">4950</id>
|
4
|
+
<description>Now this one should be green not red</description>
|
5
|
+
<status-id type="integer">2</status-id>
|
6
|
+
<priority-id type="integer" nil="true"></priority-id>
|
7
|
+
<assigned-to-id type="integer">1798</assigned-to-id>
|
8
|
+
<comments type="array">
|
9
|
+
<comment>
|
10
|
+
<id type="integer">9760</id>
|
11
|
+
<created-at type="datetime">2011-08-18T19:57:56Z</created-at>
|
12
|
+
<text>I'm working on this already</text>
|
13
|
+
<user-id type="integer">1798</user-id>
|
14
|
+
</comment>
|
15
|
+
</comments>
|
16
|
+
</task>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "BugherdAPI::Project" do
|
4
|
+
before(:each) do
|
5
|
+
BugherdAPI.authenticate('user@email.com', '123456')
|
6
|
+
ActiveResource::HttpMock.respond_to do |mock|
|
7
|
+
mock.get '/api_v1/projects.xml', {}, fixture_for('projects', 'xml'), 200
|
8
|
+
mock.get '/api_v1/projects/1458.xml', {}, fixture_for('projects/1458','xml'), 200
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
context "Project retrieval" do
|
13
|
+
it "should load all projects" do
|
14
|
+
projects = BugherdAPI::Project.find(:all)
|
15
|
+
projects.should_not be_nil
|
16
|
+
end
|
17
|
+
|
18
|
+
it "shoulod load a single project" do
|
19
|
+
project = BugherdAPI::Project.find(1458)
|
20
|
+
project.should_not be_nil
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should check for projects fields" do
|
24
|
+
project = BugherdAPI::Project.find(1458)
|
25
|
+
project.name.should == 'clutchapptest'
|
26
|
+
project.devurl.should == 'http://clutchapptest.ticketmaster.com'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context "Project creation, update and delete" do
|
31
|
+
it "should create a project"
|
32
|
+
it "should update a project"
|
33
|
+
it "should delete a project"
|
34
|
+
end
|
35
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'bugherd-api'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def fixture_for(name, format = 'xml')
|
15
|
+
File.read(File.dirname(__FILE__) + "/fixtures/#{name}.#{format}")
|
16
|
+
end
|
data/spec/task_spec.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "BugherdAPI::Task" do
|
4
|
+
before(:each) do
|
5
|
+
BugherdAPI.authenticate('user@email.com', '123456')
|
6
|
+
ActiveResource::HttpMock.respond_to do |mock|
|
7
|
+
mock.get '/api_v1/projects/1458/tasks.xml', {}, fixture_for('tasks', 'xml'), 200
|
8
|
+
mock.get '/api_v1/projects/1458/tasks/4950.xml', {}, fixture_for('tasks/4950', 'xml'), 200
|
9
|
+
end
|
10
|
+
@project_id = 1458
|
11
|
+
end
|
12
|
+
|
13
|
+
context "Retrieving tasks" do
|
14
|
+
it "should retrieve all tasks" do
|
15
|
+
tasks = BugherdAPI::Task.find(:all, :params => { :project_id => @project_id })
|
16
|
+
tasks.should_not be_nil
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should retrieve a single task" do
|
20
|
+
task = BugherdAPI::Task.find(4950, :params => { :project_id => @project_id })
|
21
|
+
task.should_not be_nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context "Creating tasks, updating and deleting" do
|
26
|
+
it "should create a task"
|
27
|
+
it "should update a task"
|
28
|
+
it "should delete a task"
|
29
|
+
end
|
30
|
+
|
31
|
+
context "Creating comments" do
|
32
|
+
it "should create a comment"
|
33
|
+
end
|
34
|
+
end
|
data/spec/user_spec.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "BugherdAPI::User" do
|
4
|
+
before(:each) do
|
5
|
+
BugherdAPI.authenticate('user@email.com', '123456')
|
6
|
+
ActiveResource::HttpMock.respond_to do |mock|
|
7
|
+
mock.get '/api_v1/users.xml', {}, fixture_for('users', 'xml'), 200
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should retrieve all users from bugherd server" do
|
12
|
+
users = BugherdAPI::User.find(:all)
|
13
|
+
users.should_not be_nil
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should retrieve valid fields for a single user" do
|
17
|
+
user = BugherdAPI::User.find(:all).first
|
18
|
+
user.name.should == 'Rafael'
|
19
|
+
user.id.should == 1798
|
20
|
+
user.surname.should == 'George'
|
21
|
+
user.email.should == 'george.rafael@gmail.com'
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bugherd-api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Rafael George
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-08-23 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
name: activesupport
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
version: "0"
|
34
|
+
requirement: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
name: activeresource
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
requirement: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
name: rspec
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 2
|
61
|
+
- 3
|
62
|
+
- 0
|
63
|
+
version: 2.3.0
|
64
|
+
requirement: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
name: bundler
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 23
|
75
|
+
segments:
|
76
|
+
- 1
|
77
|
+
- 0
|
78
|
+
- 0
|
79
|
+
version: 1.0.0
|
80
|
+
requirement: *id004
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
name: jeweler
|
85
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 7
|
91
|
+
segments:
|
92
|
+
- 1
|
93
|
+
- 6
|
94
|
+
- 4
|
95
|
+
version: 1.6.4
|
96
|
+
requirement: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
type: :development
|
99
|
+
prerelease: false
|
100
|
+
name: rcov
|
101
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 3
|
107
|
+
segments:
|
108
|
+
- 0
|
109
|
+
version: "0"
|
110
|
+
requirement: *id006
|
111
|
+
description: BugherdAPI wrapper
|
112
|
+
email: george.rafael@gmail.com
|
113
|
+
executables: []
|
114
|
+
|
115
|
+
extensions: []
|
116
|
+
|
117
|
+
extra_rdoc_files:
|
118
|
+
- LICENSE.txt
|
119
|
+
- README.rdoc
|
120
|
+
files:
|
121
|
+
- .document
|
122
|
+
- .rspec
|
123
|
+
- Gemfile
|
124
|
+
- Gemfile.lock
|
125
|
+
- LICENSE.txt
|
126
|
+
- README.rdoc
|
127
|
+
- Rakefile
|
128
|
+
- VERSION
|
129
|
+
- bugherd-api.gemspec
|
130
|
+
- lib/bugherd-api.rb
|
131
|
+
- lib/bugherd.rb
|
132
|
+
- lib/bugherd/.project.rb.swp
|
133
|
+
- lib/bugherd/base.rb
|
134
|
+
- lib/bugherd/project.rb
|
135
|
+
- lib/bugherd/task.rb
|
136
|
+
- lib/bugherd/user.rb
|
137
|
+
- spec/.project_spec.rb.swp
|
138
|
+
- spec/bugherd-api_spec.rb
|
139
|
+
- spec/fixtures/.projects.xml.swp
|
140
|
+
- spec/fixtures/projects.xml
|
141
|
+
- spec/fixtures/projects/.1458.xml.swp
|
142
|
+
- spec/fixtures/projects/1458.xml
|
143
|
+
- spec/fixtures/tasks.xml
|
144
|
+
- spec/fixtures/tasks/4950.xml
|
145
|
+
- spec/fixtures/users.xml
|
146
|
+
- spec/project_spec.rb
|
147
|
+
- spec/spec_helper.rb
|
148
|
+
- spec/task_spec.rb
|
149
|
+
- spec/user_spec.rb
|
150
|
+
has_rdoc: true
|
151
|
+
homepage: http://github.com/cored/bugherd-api
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
post_install_message:
|
155
|
+
rdoc_options: []
|
156
|
+
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
161
|
+
requirements:
|
162
|
+
- - ">="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
hash: 3
|
165
|
+
segments:
|
166
|
+
- 0
|
167
|
+
version: "0"
|
168
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
hash: 3
|
174
|
+
segments:
|
175
|
+
- 0
|
176
|
+
version: "0"
|
177
|
+
requirements: []
|
178
|
+
|
179
|
+
rubyforge_project:
|
180
|
+
rubygems_version: 1.3.7
|
181
|
+
signing_key:
|
182
|
+
specification_version: 3
|
183
|
+
summary: BugherdAPI wrapper
|
184
|
+
test_files: []
|
185
|
+
|