Created
August 13, 2008 05:23
-
-
Save oliyoung/5198 to your computer and use it in GitHub Desktop.
take a design yaml document and convert it to spec files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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