Sha256: bc7c37bebcf9da1bfd38dd50079db4aeca382c476125c62ec1ac3443671d6a4e

Contents?: true

Size: 846 Bytes

Versions: 2

Compression:

Stored size: 846 Bytes

Contents

# encoding: utf-8

desc "Run specs"
task :spec, :spec do |task, args|
  exec "./script/spec --options spec/spec.opts #{args.spec || "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/simple-templater/**/*.rb") + ["spec/simple-teplater_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
simple-templater-0.0.1.4 tasks/spec.rake
simple-templater-0.1.pre tasks/spec.rake