lib/nake/tasks/spec.rb in nake-0.0.8.pre vs lib/nake/tasks/spec.rb in nake-0.0.8

- old
+ new

@@ -1,30 +1,20 @@ # encoding: utf-8 # ./tasks.rb spec/nake/argv_spec.rb spec/nake/task_spec.rb task(:spec) do |*paths, options| paths.push("spec") if paths.empty? - sh "spec #{paths.join(" ")}" + sh "spec", *paths end Task.new("spec:stubs") do |task| task.description = "Create stubs of all library files." task.define do Dir.glob("lib/**/*.rb").each do |file| specfile = file.sub(/^lib/, "spec").sub(/\.rb$/, '_spec.rb') unless File.exist?(specfile) - %x[mkdir -p #{File.dirname(specfile)}] - %x[touch #{specfile}] - puts "Created #{specfile}" - end - end - (Dir.glob("spec/rango/**/*.rb") + ["spec/rango_spec.rb"]).each do |file| - libfile = file.sub(/spec/, "lib").sub(/_spec\.rb$/, '.rb') - if !File.exist?(libfile) && File.zero?(file) - %x[rm #{file}] - puts "Removed empty file #{file}" - elsif !File.exist?(libfile) - puts "File exists just in spec, not in lib: #{file}" + sh "mkdir -p #{File.dirname(specfile)}" + sh "touch #{specfile}" end end end end