rcov_rails 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/tasks/coverage.rake +20 -4
  2. metadata +4 -4
@@ -14,11 +14,20 @@ begin
14
14
  require File.expand_path(File.join(File.dirname(__FILE__), "..", "rcov_rails/rcovtask"))
15
15
 
16
16
  def coverage_task(name, aspects, task_description)
17
- aspect_tasks = aspects.map{ |aspect| "test:coverage:_#{aspect}" }
17
+ aspect_tasks = Array(aspects).map{ |aspect| "test:coverage:_#{aspect}" }
18
18
 
19
19
  desc(task_description)
20
20
 
21
- task name => ["test:coverage:reset"] + aspect_tasks + ["test:coverage:generate"] do
21
+ task name => ["test:coverage:reset"] + aspect_tasks do
22
+
23
+ generator_task = if aspects == :units
24
+ "generate_without_controllers"
25
+ else
26
+ "generate"
27
+ end
28
+
29
+ Rake::Task["test:coverage:#{generator_task}"].invoke()
30
+
22
31
  if defined?(RUBY_PLATFORM) && RUBY_PLATFORM['darwin']
23
32
  system("open coverage/index.html")
24
33
  else
@@ -42,10 +51,10 @@ begin
42
51
  t.libs << "test"
43
52
  t.test_files = Dir["test/#{scope.singularize}/**/*_test.rb"]
44
53
  t.add_descriptions = false
45
- t.rcov_opts = ["--no-html", "--aggregate coverage.data", "--exclude '^(?!(app|lib))'"]
54
+ t.rcov_opts = ["--no-html", "--aggregate coverage.data"]
46
55
  end
47
56
 
48
- coverage_task(scope, [scope], "run the #{scope} tests with coverage")
57
+ coverage_task(scope, scope.to_sym, "run the #{scope} tests with coverage")
49
58
  end
50
59
 
51
60
  task :reset do
@@ -59,6 +68,13 @@ begin
59
68
  t.add_descriptions = false
60
69
  t.rcov_opts = ["--html", "--aggregate coverage.data", "--exclude '^(?!(app|lib))'"]
61
70
  end
71
+
72
+ RcovRails::RcovTask.new(:generate_without_controllers) do |t|
73
+ t.libs << "test"
74
+ t.test_files = []
75
+ t.add_descriptions = false
76
+ t.rcov_opts = ["--html", "--aggregate coverage.data", "--exclude '^(?!(app|lib))'", "--exclude '^app[\\/\/]controllers'"]
77
+ end
62
78
 
63
79
  end
64
80
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcov_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew Rudy Jacobs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-20 00:00:00 +01:00
18
+ date: 2010-12-15 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency