unfuddler 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,12 +4,16 @@ Unfuddler is a simple Ruby API to Unfuddle's projects and tickets. Primarily mad
4
4
 
5
5
  ## Usage
6
6
 
7
+ First of all, authentiate with your information:
7
8
  Unfuddler.authenticate(:username => "john", :password => "seekrit", :subdomain => "johnscompany")
8
- # Project#find returns all projects, fetching last element from array with Array#last
9
+
10
+ Now, find your project
9
11
  project = Unfuddler.project.find.last
10
- # Fetch all new tickets where the status is new
12
+
13
+ Get ALL the tickets from this project, where the status is "new"
11
14
  new_tickets = project.tickets.find(:status => "new")
12
- # Close ticket with a resolution
15
+
16
+ Let's close the last of these tickets, with a resolution.
13
17
  new_tickets.first.close!(:resolution => "fixed", :description => "I fixed it!")
14
18
 
15
19
  ## Note on Patches/Pull Requests
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/lib/unfuddler.rb CHANGED
@@ -112,7 +112,7 @@ module Unfuddler
112
112
  length = method[0..-3] if method == :closed!
113
113
  length = method[0..-2] if [:new!, :resolved!].include?(method)
114
114
 
115
- define_method((length || method[0..-4]) + "!") do |resolution|
115
+ define_method((length || method[0..-4]) + "!") do |resolution = {}|
116
116
  name = method[0..-2] # No "!"
117
117
  update = {:status => name}
118
118
 
@@ -3,23 +3,47 @@ require 'helper'
3
3
  class TestUnfuddler < Test::Unit::TestCase
4
4
  context "an Unfuddler project instance" do
5
5
  setup do
6
- #Unfuddler.authenticate(:username => "user", :password => "", :subdomain => "ticketmaster")
6
+ Unfuddler.authenticate(:username => "", :password => "", :subdomain => "ticketmaster")
7
7
  @project = Unfuddler::Project.find.first
8
8
  end
9
9
 
10
- should "find a ticket" do
11
- ticket = @project.tickets.first
12
- assert ticket.is_a?(Unfuddler::Ticket)
10
+ should "be a project" do
11
+ assert @project.is_a?(Unfuddler::Project)
13
12
  end
14
13
 
15
- should "be able to create a ticket" do
16
- # Should return an empty hash on success
17
- assert @project.ticket.create(:priority => "3", :description => "This is a test ticket made by Unfuddler", :summary => "Test Ticket").empty?
14
+ should "have authentication information" do
15
+ assert Unfuddler.subdomain.is_a?(String)
16
+ assert Unfuddler.username.is_a?(String)
17
+ assert Unfuddler.password.is_a?(String)
18
18
  end
19
19
 
20
- should "be able to delete the newly created ticket, which should be the last one" do
21
- # Should return an empty hash on success
22
- assert @project.tickets.last.delete.empty?
20
+ should "find new tickets assosicated with self" do
21
+ tickets = @project.tickets(:status => "new")
22
+ assert tickets.is_a?(Array)
23
+ assert tickets.last.is_a?(Unfuddler::Ticket)
24
+ end
25
+
26
+ context "with a ticket instance" do
27
+ setup do
28
+ @ticket = @project.tickets.last
29
+ end
30
+
31
+ should "be a ticket" do
32
+ assert @ticket.is_a?(Unfuddler::Ticket)
33
+ end
34
+
35
+ should "close the last ticket with a resolution" do
36
+ assert @ticket.close!(:resolution => "fixed", :description => "Fixed it").empty?
37
+ end
38
+
39
+ should "reopen the last ticket" do
40
+ assert @ticket.reopen!
41
+ end
42
+
43
+ should "delete the last ticket" do
44
+ # Should return an empty hash on success
45
+ assert @ticket.delete.empty?
46
+ end
23
47
  end
24
48
  end
25
49
  end
data/unfuddler.gemspec ADDED
@@ -0,0 +1,63 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{unfuddler}
8
+ s.version = "0.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Sirupsen"]
12
+ s.date = %q{2010-05-25}
13
+ s.description = %q{Provides a simple Ruby API to Unfuddle.}
14
+ s.email = %q{sirup@sirupsen.dk}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/unfuddler.rb",
27
+ "test/helper.rb",
28
+ "test/test_unfuddler.rb",
29
+ "unfuddler.gemspec"
30
+ ]
31
+ s.homepage = %q{http://github.com/Sirupsen/unfuddler}
32
+ s.rdoc_options = ["--charset=UTF-8"]
33
+ s.require_paths = ["lib"]
34
+ s.rubygems_version = %q{1.3.7}
35
+ s.summary = %q{Provides a simple Ruby API to Unfuddle.}
36
+ s.test_files = [
37
+ "test/helper.rb",
38
+ "test/test_unfuddler.rb"
39
+ ]
40
+
41
+ if s.respond_to? :specification_version then
42
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
+ s.specification_version = 3
44
+
45
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
47
+ s.add_runtime_dependency(%q<hashie>, [">= 0.2.0"])
48
+ s.add_runtime_dependency(%q<crack>, [">= 0.1.6"])
49
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3.5"])
50
+ else
51
+ s.add_dependency(%q<shoulda>, [">= 0"])
52
+ s.add_dependency(%q<hashie>, [">= 0.2.0"])
53
+ s.add_dependency(%q<crack>, [">= 0.1.6"])
54
+ s.add_dependency(%q<activesupport>, [">= 2.3.5"])
55
+ end
56
+ else
57
+ s.add_dependency(%q<shoulda>, [">= 0"])
58
+ s.add_dependency(%q<hashie>, [">= 0.2.0"])
59
+ s.add_dependency(%q<crack>, [">= 0.1.6"])
60
+ s.add_dependency(%q<activesupport>, [">= 2.3.5"])
61
+ end
62
+ end
63
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unfuddler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sirupsen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-23 00:00:00 +02:00
18
+ date: 2010-05-25 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -99,6 +99,7 @@ files:
99
99
  - lib/unfuddler.rb
100
100
  - test/helper.rb
101
101
  - test/test_unfuddler.rb
102
+ - unfuddler.gemspec
102
103
  has_rdoc: true
103
104
  homepage: http://github.com/Sirupsen/unfuddler
104
105
  licenses: []