add dspec task to test dist file; revert spec task to normal behavior
This commit is contained in:
parent
e0b82d37af
commit
82fbd34149
11
Rakefile.rb
11
Rakefile.rb
@ -18,8 +18,6 @@ task :build_dist do
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
||||
FileUtils.mkdir_p("test")
|
||||
FileUtils.cp("dist/rscons", "test/rscons.rb")
|
||||
if args.example_string
|
||||
ENV["partial_specs"] = "1"
|
||||
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
||||
@ -28,6 +26,15 @@ end
|
||||
|
||||
task :spec => :build_dist
|
||||
|
||||
desc "Dist Specs"
|
||||
task :dspec, [:example_string] 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)
|
||||
ENV.delete("dist_specs")
|
||||
end
|
||||
|
||||
YARD::Rake::YardocTask.new do |yard|
|
||||
yard.files = ['lib/**/*.rb']
|
||||
end
|
||||
|
@ -96,7 +96,12 @@ describe Rscons do
|
||||
[]
|
||||
end
|
||||
rscons_args = options[:rscons_args] || []
|
||||
command = %W[ruby -I. -r _simplecov_setup #{@owd}/test/rscons.rb] + rsconscript_args + rscons_args + operation
|
||||
if ENV["dist_specs"]
|
||||
exe = "#{@owd}/test/rscons.rb"
|
||||
else
|
||||
exe = "#{@owd}/bin/rscons"
|
||||
end
|
||||
command = %W[ruby -I. -r _simplecov_setup #{exe}] + rsconscript_args + rscons_args + operation
|
||||
@statics[:build_test_id] ||= 0
|
||||
@statics[:build_test_id] += 1
|
||||
command_prefix =
|
||||
@ -128,6 +133,9 @@ end
|
||||
ENV["TERM"] = nil
|
||||
#{options[:ruby_setup_code]}
|
||||
EOF
|
||||
unless ENV["dist_specs"]
|
||||
fh.puts %[$LOAD_PATH.unshift(#{@owd.inspect} + "/lib")]
|
||||
end
|
||||
end
|
||||
stdout, stderr, status = nil, nil, nil
|
||||
Bundler.with_clean_env do
|
||||
|
@ -12,4 +12,8 @@ SimpleCov.start do
|
||||
merge_timeout 3600
|
||||
end
|
||||
|
||||
require_relative "../test/rscons"
|
||||
if ENV["dist_specs"]
|
||||
require_relative "../test/rscons"
|
||||
else
|
||||
require "rscons"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user