Do not run simplecov on dspec specs
This commit is contained in:
parent
556c821cc6
commit
87a6d9f04f
@ -17,12 +17,16 @@ task :build_dist do
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
||||
ENV["specs"] = "1"
|
||||
if args.example_string
|
||||
ENV["partial_specs"] = "1"
|
||||
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
||||
end
|
||||
end
|
||||
task :spec => :build_dist
|
||||
task :spec do
|
||||
ENV.delete("specs")
|
||||
end
|
||||
|
||||
# dspec task is useful to test the distributable release script, but is not
|
||||
# useful for coverage information.
|
||||
@ -31,7 +35,7 @@ task :dspec, [:example_string] => :build_dist do |task, args|
|
||||
FileUtils.mkdir_p("test")
|
||||
FileUtils.cp("dist/rscons", "test/rscons.rb")
|
||||
ENV["dist_specs"] = "1"
|
||||
Rake::Task["spec"].invoke(args.example_string)
|
||||
Rake::Task["spec"].execute(args.example_string)
|
||||
ENV.delete("dist_specs")
|
||||
FileUtils.rm_f(Dir.glob(".rscons-*"))
|
||||
end
|
||||
@ -99,6 +103,7 @@ task :default => :spec
|
||||
task :all => [
|
||||
:build_dist,
|
||||
:spec,
|
||||
:dspec,
|
||||
:yard,
|
||||
:user_guide,
|
||||
]
|
||||
|
@ -118,6 +118,7 @@ describe Rscons do
|
||||
command_name = "#{command_prefix}#{@statics[:build_test_id]}"
|
||||
File.open("_simplecov_setup.rb", "w") do |fh|
|
||||
fh.puts <<EOF
|
||||
unless ENV["dist_specs"]
|
||||
require "bundler"
|
||||
Bundler.setup
|
||||
require "simplecov"
|
||||
@ -134,6 +135,7 @@ SimpleCov.start do
|
||||
end
|
||||
formatter(MyFormatter)
|
||||
end
|
||||
end
|
||||
# force color off
|
||||
ENV["TERM"] = nil
|
||||
#{options[:ruby_setup_code]}
|
||||
|
@ -1,3 +1,6 @@
|
||||
if ENV["dist_specs"]
|
||||
require_relative "../test/rscons"
|
||||
else
|
||||
require "simplecov"
|
||||
|
||||
SimpleCov.start do
|
||||
@ -18,8 +21,5 @@ SimpleCov.start do
|
||||
merge_timeout 3600
|
||||
end
|
||||
|
||||
if ENV["dist_specs"]
|
||||
require_relative "../test/rscons"
|
||||
else
|
||||
require "rscons"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user