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