testdoc 0.0.2

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/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ == 0.0.1 2009-01-08
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
data/Manifest.txt ADDED
@@ -0,0 +1,19 @@
1
+ History.txt
2
+ Manifest.txt
3
+ PostInstall.txt
4
+ README.rdoc
5
+ Rakefile
6
+ lib/testdoc.rb
7
+ lib/testdoc_module.rb
8
+ lib/testdoc/testdocoptions.rb
9
+ lib/testdoc/testdocparser.rb
10
+ lib/testdoc/footer.html.erb
11
+ lib/testdoc/header.html.erb
12
+ lib/testdoc/template.html.erb
13
+ lib/testdoc/template.debug.erb
14
+ script/console
15
+ script/destroy
16
+ script/generate
17
+ test/test_helper.rb
18
+ test/test_testdoc.rb
19
+ bin/testdoc
data/PostInstall.txt ADDED
@@ -0,0 +1,7 @@
1
+
2
+ For more information on testdoc, see http://testdoc.rubyforge.org
3
+
4
+ NOTE: Change this information in PostInstall.txt
5
+ You can also delete it if you don't want it.
6
+
7
+
data/README.rdoc ADDED
@@ -0,0 +1,72 @@
1
+ = testdoc
2
+
3
+ * FIX (url)
4
+
5
+ == DESCRIPTION:
6
+
7
+ Generate testplans from annotated sourcecode.
8
+
9
+ Author: Thomas Flemming, thomasfl(snabela)usit.uio.no
10
+
11
+ == FEATURES/PROBLEMS:
12
+
13
+ * Only supports ruby sourcecode.
14
+
15
+ == SYNOPSIS:
16
+
17
+ Examples:
18
+
19
+ $testdoc
20
+ $testdoc rubyfil.rb
21
+ $testdoc --title "Overskrift" rubyfil.rb
22
+ $testdoc *.rb
23
+ $testdoc --help
24
+
25
+ Sample ruby sourcecode annotations:
26
+
27
+ # testplan: Title
28
+ # test: Title
29
+ # task: Title
30
+ # multiline
31
+ # check: Title
32
+
33
+ Syntax:
34
+
35
+ TESTPLAN => [#testplan: .*] TESTS
36
+ TEST => '#test:' TITLE TASKS*
37
+ TITLE => .*\n [#.*]*
38
+ TASKS => '#task:' CHECKS* *
39
+ CHECKS => '#checks' TITLE
40
+
41
+ == REQUIREMENTS:
42
+
43
+ * FIX (list of requirements)
44
+
45
+ == INSTALL:
46
+
47
+ * FIX (TODO sudo gem install, anything else)
48
+
49
+ == LICENSE:
50
+
51
+ (The MIT License)
52
+
53
+ Copyright (c) 2009 TestDoc
54
+
55
+ Permission is hereby granted, free of charge, to any person obtaining
56
+ a copy of this software and associated documentation files (the
57
+ 'Software'), to deal in the Software without restriction, including
58
+ without limitation the rights to use, copy, modify, merge, publish,
59
+ distribute, sublicense, and/or sell copies of the Software, and to
60
+ permit persons to whom the Software is furnished to do so, subject to
61
+ the following conditions:
62
+
63
+ The above copyright notice and this permission notice shall be
64
+ included in all copies or substantial portions of the Software.
65
+
66
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
67
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
68
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
69
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
70
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
71
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
72
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ %w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
2
+ require File.dirname(__FILE__) + '/lib/testdoc'
3
+
4
+ # Generate all the Rake tasks
5
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
6
+ $hoe = Hoe.new('testdoc', TestDoc::VERSION) do |p|
7
+ p.developer('FIXME full name', 'FIXME email')
8
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
9
+ p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
10
+ p.rubyforge_name = p.name # TODO this is default value
11
+ # p.extra_deps = [
12
+ # ['activesupport','>= 2.0.2'],
13
+ # ]
14
+ p.extra_dev_deps = [
15
+ ['newgem', ">= #{::Newgem::VERSION}"]
16
+ ]
17
+
18
+ p.clean_globs |= %w[**/.DS_Store tmp *.log]
19
+ path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
20
+ p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
21
+ p.rsync_args = '-av --delete --ignore-errors'
22
+ end
23
+
24
+ require 'newgem/tasks' # load /tasks/*.rake
25
+ Dir['tasks/**/*.rake'].each { |t| load t }
26
+
27
+ # TODO - want other tests/tasks run by default? Add them to the list
28
+ # task :default => [:spec, :features]
data/bin/testdoc ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'testdoc'
5
+
6
+ if %w(-v --version).include? ARGV.first
7
+ require File.dirname(__FILE__) + "/../lib/testdoc"
8
+ puts "#{File.basename($0)} #{TestDoc::VERSION}"
9
+
10
+ exit(0)
11
+ end
12
+
13
+ require File.dirname(__FILE__) + "/../lib/testdoc_module"
14
+
15
+ t = TestDoc::TestDoc.new
16
+ t.document(ARGV)
@@ -0,0 +1,5 @@
1
+
2
+
3
+ <p>Generated by testdoc.rb</p>
4
+ </body>
5
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title><%=@title%></title>
6
+ <link rel="stylesheet" href="http://www.usit.uio.no/visuell-profil/css/uio.css" type="text/css">
7
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
8
+ <meta name="robots" content="index,nofollow" />
9
+ </head>
10
+ <body>
11
+ <h1><%=@title%></h1>
12
+
13
+
@@ -0,0 +1,21 @@
1
+ <% testplans.each do |testplan| %>
2
+ <% if testplan.title != nil %>
3
+ testplan:<%= testplan.title %>
4
+ <% end %>
5
+
6
+ <% testplan.tests.each do |test| %>
7
+ test: <%=test.title%> (id:<%=test.id%> tasks:<%=test.tasks.size%>) checks:<%=test.number_of_checks%>
8
+
9
+ <% test.tasks.each do |task| %>
10
+ task: <%=task.title%> (id:<%=task.id%>)
11
+ <%if (task.checks == nil)%>
12
+ check: NIL
13
+ <%end%>
14
+ <% task.checks.each do |check| %>
15
+ check:<%=check.title %> (id:<%=check.id%>)
16
+
17
+ <% end %>
18
+ <% end %>
19
+ <% end %>
20
+ <% end %>
21
+
@@ -0,0 +1,61 @@
1
+ <% testplans.each do |testplan| %>
2
+ <% if testplan.title != nil %><h2><%= testplan.title %><% end %></h2>
3
+ <% if testplan.comments != nil %><p><%= testplan.comments %><% end %></p>
4
+ <% if (testplan.tests == nil) then
5
+ exit(0)
6
+ end %>
7
+ <table cellpadding="3" border="1" width="80%">
8
+ <tr align="left">
9
+ <td><b>Nr</b>
10
+ <td><b>Betegnelse</b></td>
11
+ <td><b>Aksjoner</b></td>
12
+ <td><b>Sjekkliste</b></td>
13
+ <td><b>Resultat</b></td>
14
+ </tr>
15
+ <%testplan.tests.each do |test| %>
16
+
17
+ <tr valign="top">
18
+ <td<%if(test.tasks.size > 1)%> rowspan="<%=test.number_of_checks%>"<%end%>><%=test.id%></td>
19
+ <td<%if(test.tasks.size > 1)%> rowspan="<%=test.number_of_checks%>"<%end%>><%=test.title%></td>
20
+ <%if (test.tasks.size == 0)%>
21
+
22
+ <td>&nbsp;</td>
23
+ <td>&nbsp;</td>
24
+ <td>&nbsp;</td>
25
+ </tr>
26
+ <%end%>
27
+ <%task_count = 0%>
28
+ <%test.tasks.each do |task| %>
29
+ <%task_count += 1%>
30
+
31
+ <td<%if(task.checks.size > 1)%> rowspan="<%=test.tasks.size %>"<%end%>><i><%=task.id%></i>:<%=task.title%> </td>
32
+ <%if (task.checks.size == 0)%>
33
+
34
+ <td>&nbsp;</td>
35
+ <td>&nbsp;</td>
36
+ </tr>
37
+
38
+ <%if(test.tasks.size > task_count)%>
39
+
40
+ <tr valign="top">
41
+ <%end%>
42
+ <%end%>
43
+ <%checks_count=0%>
44
+ <%task.checks.each do |check| %>
45
+ <%checks_count += 1%>
46
+
47
+ <td><i><%=check.id%></i>: <%=check.title %></td>
48
+ <td>&nbsp;</td>
49
+ </tr>
50
+ <%if( task.checks.size > checks_count || test.tasks.size > task_count)%>
51
+
52
+ <tr>
53
+ <%end%>
54
+ <%end%>
55
+ <%end%>
56
+ <%end%>
57
+
58
+ </table>
59
+ <%end%>
60
+
61
+