public
Description: A Ruby web application framework
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack.git
Search Repo:
Click here to lend your support to: mack and make a donation at www.pledgie.com !
 Added test:stats and test:coverage Rake tasks.
markbates (author)
Thu May 01 17:42:26 -0700 2008
commit  9c5289d64823871ed7a33a6a8baf024d0fe930f8
tree    e3b851119f04d71a641c6f0a4eb3bb995b1a44b6
parent  668ce481e0281f37e3cd9d2683931fedf1e53875
...
7
8
9
 
 
...
7
8
9
10
11
0
@@ -7,4 +7,6 @@
0
 *.pid
0
 test/fake_application/public/something/logo.gif
0
 test/fake_application/db/fake_application_test.db
0
+coverage/**/*.*
0
+coverage/*.*
...
 
1
2
3
...
7
8
9
 
10
11
12
...
1
2
3
4
...
8
9
10
11
12
13
14
0
@@ -1,3 +1,4 @@
0
+* Added test:stats and test:coverage Rake tasks.
0
 * Removed support for ActiveRecord
0
 * Fixed a bug where yields in ERB weren't giving the desired results.
0
 * DataMapper database.yml file can now be nested, and is generated as such.
0
@@ -7,6 +8,7 @@
0
 * gem: mack_ruby_core_extensions 0.1.22
0
 * gem: genosaurus 1.1.3
0
 * gem: datamapper 0.3.2
0
+* gem: rcov 0.8.1.2.0
0
 
0
 ===0.4.7
0
 * Added Mack::Request::UploadedFile class to make dealing with file uploads easy.
...
8
9
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
12
13
...
20
21
22
 
 
...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
40
41
42
43
44
0
@@ -8,6 +8,26 @@
0
 
0
 namespace :test do
0
   
0
+ desc "Report code statistics (KLOCs, etc) from the application. Requires the rcov gem."
0
+ task :stats do |t|
0
+ x = `rcov test/**/*_test.rb -T --no-html`
0
+ @print = false
0
+ x.each do |line|
0
+ puts line if @print
0
+ unless @print
0
+ if line.match(/\d+ tests, \d+ assertions, \d+ failures, \d+ errors/)
0
+ @print = true
0
+ end
0
+ end
0
+ end
0
+ end
0
+
0
+ desc "Generates test coverage from the application. Requires the rcov gem."
0
+ task :coverage do |t|
0
+ `rcov test/**/*_test.rb`
0
+ `open coverage/index.html`
0
+ end
0
+
0
   task :empty do |t|
0
     ENV["TEST:EMPTY"] = "true"
0
     puts ENV["TEST:EMPTY"]
0
@@ -20,4 +40,6 @@
0
 end
0
 
0
 alias_task :test, :default
0
+alias_task :stats, "test:stats"
0
+alias_task :coverage, "test:coverage"
...
59
60
61
 
62
63
64
...
59
60
61
62
63
64
65
0
@@ -59,6 +59,7 @@
0
         s.add_dependency("erubis", "2.5.0")
0
         s.add_dependency("genosaurus", "1.1.3")
0
         s.add_dependency("datamapper", "0.3.2")
0
+ s.add_dependency("rcov", "0.8.1.2.0")
0
         
0
       
0
         s.rubyforge_project = gh.project

Comments

    No one has commented yet.