Add dspec task to test distributable script
This commit is contained in:
parent
547dbd3850
commit
db6dc0e099
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@
|
||||
/tmp/
|
||||
/.rspec_status
|
||||
/spec/run/
|
||||
/dspec/
|
||||
|
12
Rakefile
12
Rakefile
@ -10,6 +10,18 @@ RSpec::Core::RakeTask.new(:spec, :example_pattern) do |task, args|
|
||||
end
|
||||
end
|
||||
|
||||
# dspec task is useful to test the distributable release script, but is not
|
||||
# useful for coverage information.
|
||||
desc "Dist Specs"
|
||||
task :dspec, [:example_string] => :build_dist do |task, args|
|
||||
FileUtils.rm_rf("dspec")
|
||||
FileUtils.mkdir_p("dspec")
|
||||
FileUtils.cp("dist/propane", "dspec/propane")
|
||||
ENV["dist_specs"] = "1"
|
||||
Rake::Task["spec"].execute(args)
|
||||
ENV.delete("dist_specs")
|
||||
end
|
||||
|
||||
task :default => :spec
|
||||
|
||||
desc "Build user guide"
|
||||
|
@ -11,7 +11,12 @@ describe Propane do
|
||||
|
||||
def build_parser(options = {})
|
||||
options[:name] ||= ""
|
||||
command = %W[./propane.sh spec/run/testparser#{options[:name]}.propane spec/run/testparser#{options[:name]}.#{options[:language]} --log spec/run/testparser#{options[:name]}.log]
|
||||
if ENV["dist_specs"]
|
||||
propane = "dspec/propane"
|
||||
else
|
||||
propane = "./propane.sh"
|
||||
end
|
||||
command = %W[#{propane} spec/run/testparser#{options[:name]}.propane spec/run/testparser#{options[:name]}.#{options[:language]} --log spec/run/testparser#{options[:name]}.log]
|
||||
if (options[:capture])
|
||||
stdout, stderr, status = Open3.capture3(*command)
|
||||
Results.new(stdout, stderr, status)
|
||||
|
Loading…
x
Reference in New Issue
Block a user