Tracker 0.1.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +45 -18
- data/Rakefile +52 -0
- data/bin/trac +69 -52
- data/lib/comment.rb +7 -0
- data/lib/environment.rb +31 -0
- data/lib/ticket.rb +38 -0
- data/lib/tracker.rb +127 -0
- metadata +22 -53
- data/MIT-LICENSE +0 -9
- data/db/migrate +0 -70
- data/lib/action.rb +0 -220
- data/lib/bug.rb +0 -63
- data/lib/bug_description.rb +0 -15
- data/lib/database.rb +0 -44
- data/lib/helper.rb +0 -16
- data/lib/interface.rb +0 -175
- data/lib/prompter.rb +0 -66
- data/test/test_action.rb +0 -147
- data/test/test_bug.rb +0 -67
- data/test/test_bug_description.rb +0 -33
- data/test/test_integration.rb +0 -0
- data/test/test_interface.rb +0 -17
data/test/test_bug.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
require "test/unit"
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + "/../lib/bug.rb"
|
4
|
-
require File.dirname(__FILE__) + "/../lib/bug_description.rb"
|
5
|
-
require File.dirname(__FILE__) + "/../lib/database.rb"
|
6
|
-
|
7
|
-
class TestBug < Test::Unit::TestCase
|
8
|
-
def setup
|
9
|
-
Database::connect_to_database(".tracker_db")
|
10
|
-
@bug_names = ["First", "Second", "Third", "Fourth"]
|
11
|
-
@bug_ids = [1, 2, 3, 4]
|
12
|
-
@bug_priorities = [1, 2, 3, 4]
|
13
|
-
@bug_areas = ["One", "Two", "Three", "Four"]
|
14
|
-
@bug_status = [true, true, false, false]
|
15
|
-
@descriptions = ["First description", "Second description", "Third description"]
|
16
|
-
end
|
17
|
-
|
18
|
-
def teardown
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_open?
|
22
|
-
bug = Bug.find_by_name("Third")
|
23
|
-
assert(bug.open?)
|
24
|
-
assert(!bug.closed?)
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_closed?
|
28
|
-
bug = Bug.find_by_name("First")
|
29
|
-
assert(bug.closed?)
|
30
|
-
assert(!bug.open?)
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_search_by_name
|
34
|
-
@bug_names.each do |name|
|
35
|
-
bug = Bug.search(name)
|
36
|
-
assert_equal(name, bug.name)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_search_by_id
|
41
|
-
4.times do |i|
|
42
|
-
bug = Bug.search(@bug_ids[i])
|
43
|
-
assert_equal(@bug_names[i], bug.name)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_create_with_date_time
|
48
|
-
bug = Bug.create(:name => "New Bug!", :priority => 1, :area => "None")
|
49
|
-
assert(bug.date_time)
|
50
|
-
bug.destroy
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_save_with_date_time
|
54
|
-
bug = Bug.new(:name => "Another new bug!", :priority => 2, :area => "None")
|
55
|
-
bug.save
|
56
|
-
assert(bug.date_time)
|
57
|
-
bug.destroy
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_destroy
|
61
|
-
bug = Bug.create(:name => "test_destroy", :priority => 1, :area => "None")
|
62
|
-
id = bug.id
|
63
|
-
bug.destroy
|
64
|
-
assert_raise(ActiveRecord::RecordNotFound) { Bug.find(id) }
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require "test/unit"
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + "/../lib/bug_description.rb"
|
4
|
-
require File.dirname(__FILE__) + "/../lib/database.rb"
|
5
|
-
|
6
|
-
class TestBugDescription < Test::Unit::TestCase
|
7
|
-
def setup
|
8
|
-
Database::connect_to_database(".tracker_db")
|
9
|
-
@bug_names = ["First", "Second", "Third", "Fourth"]
|
10
|
-
@bug_ids = [1, 2, 3, 4]
|
11
|
-
@bug_priorities = [1, 2, 3, 4]
|
12
|
-
@bug_areas = ["One", "Two", "Three", "Four"]
|
13
|
-
@bug_status = [true, true, false, false]
|
14
|
-
@descriptions = ["First description", "Second description", "Third description"]
|
15
|
-
end
|
16
|
-
|
17
|
-
def teardown
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_create_with_date_time
|
22
|
-
description = BugDescription.create(:description => "A new description for the first bug.", :bug_id => 1)
|
23
|
-
assert(description.date_time)
|
24
|
-
description.destroy
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_save_with_date_time
|
28
|
-
description = BugDescription.new(:description => "A new description for the second bug.", :bug_id => 2)
|
29
|
-
description.save
|
30
|
-
assert(description.date_time)
|
31
|
-
description.destroy
|
32
|
-
end
|
33
|
-
end
|
data/test/test_integration.rb
DELETED
File without changes
|
data/test/test_interface.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require "test/unit"
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + "/../lib/interface.rb"
|
4
|
-
|
5
|
-
class TestInterface < Test::Unit::TestCase
|
6
|
-
def setup
|
7
|
-
@interface = Interface.new
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_truth
|
11
|
-
assert(true, "Test truth.")
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_parse_help
|
15
|
-
assert true
|
16
|
-
end
|
17
|
-
end
|