Module: RcovStatsRelated::Integrations::Rspec

Defined in:
lib/rcov_stats_related/integrations/rspec.rb

Instance Method Summary collapse

Instance Method Details

#invokeObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rcov_stats_related/integrations/rspec.rb', line 5

def invoke
  require 'spec/rake/spectask'

  rcov_tests = parse_file_to_test(files_to_test)
  return false if rcov_tests.empty?
  Spec::Rake::SpecTask.new(@name) do |t|
    t.spec_files = rcov_tests
    t.rcov = true
    begin
      t.rcov_dir =  File.join(self.class.root, "coverage", @name)
    rescue
    end
    files_to_cover_parsed = parse_file_to_cover(files_to_cover).map { |f| "(#{f})".gsub("/", "\/") }.join("|")
    t.rcov_opts = ["--text-summary", "--sort", "coverage", "--output", "#{File.join(self.class.root, "coverage", @name)}", "--exclude", "\"^(?!(#{files_to_cover_parsed}))\""]
  end
end

#test_nameObject



22
23
24
# File 'lib/rcov_stats_related/integrations/rspec.rb', line 22

def test_name
  "spec"
end