Sha256: 384e17c10447823e61520dec99ecd1dd914c1455aae36c16a214451d58e07cc0
Contents?: true
Size: 823 Bytes
Versions: 2
Compression:
Stored size: 823 Bytes
Contents
# encoding: utf-8 desc "Run specs" task :spec, :path do |task, args| exec "./script/spec --options spec/spec.opts #{args.path || "spec"}" end desc "Create stubs of all library files." task "spec:stubs" 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/pupu/**/*.rb") + ["spec/pupu_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}" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pupu-0.0.2.pre | tasks/spec.rake |
pupu-0.1.pre | tasks/spec.rake |