Module: RcovStatsRelated::Integrations::Rspec2

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

Instance Method Summary collapse

Instance Method Details

#invokeObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rcov_stats_related/integrations/rspec2.rb', line 5

def invoke
  require 'rspec/core/rake_task'

  rcov_tests = parse_file_to_test(files_to_test)
  return false if rcov_tests.empty?
  RSpec::Core::RakeTask.new(@name) do |t|
    t.pattern = rcov_tests
    t.rcov = true
    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



18
19
20
# File 'lib/rcov_stats_related/integrations/rspec2.rb', line 18

def test_name
  "spec"
end