From 87a6d9f04f7c7572ad7e965c90d80cdbe51e54e1 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 22 Oct 2021 13:55:51 -0400 Subject: [PATCH] Do not run simplecov on dspec specs --- Rakefile.rb | 7 ++++++- spec/build_tests_spec.rb | 28 +++++++++++++++------------- spec/spec_helper.rb | 40 ++++++++++++++++++++-------------------- 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/Rakefile.rb b/Rakefile.rb index ce21fd3..cf00be9 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -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, ] diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index 31e6b24..28a38af 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -118,21 +118,23 @@ describe Rscons do command_name = "#{command_prefix}#{@statics[:build_test_id]}" File.open("_simplecov_setup.rb", "w") do |fh| fh.puts <