Sha256: 581dffeb7c26e4e5a3bca124991b7b08660b2ae5d010eeb46ba5df0bddde7e11
Contents?: true
Size: 835 Bytes
Versions: 3
Compression:
Stored size: 835 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/media-path/**/*.rb") + ["spec/media-path_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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
media-path-0.1.2 | tasks/spec.rake |
media-path-0.2.pre | tasks/spec.rake |
media-path-0.1.1.pre | tasks/spec.rake |