Skip to content

Instantly share code, notes, and snippets.

@oliyoung
Created August 13, 2008 05:23
Show Gist options
  • Save oliyoung/5198 to your computer and use it in GitHub Desktop.
Save oliyoung/5198 to your computer and use it in GitHub Desktop.
take a design yaml document and convert it to spec files
desc "Push design.yml to spec files"
task :design do
require 'yaml'
specs = YAML::load_file './spec/design.yml'
specs.each_pair do |describe, specs_array|
spec_file = File.new("./spec/#{describe.downcase.gsub(/ /, '_')}_spec.rb", 'w')
spec_file.puts "
require File.dirname(__FILE__) + '/spec_helper'
describe \"#{describe}\" do
#{specs_array.map {|spec| " it \"#{spec}\" " }}
end
"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment