]> git.openstreetmap.org Git - rails.git/blobdiff - script/yaml_to_spec
added application.yml, refactored map method
[rails.git] / script / yaml_to_spec
diff --git a/script/yaml_to_spec b/script/yaml_to_spec
new file mode 100755 (executable)
index 0000000..4577d91
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env ruby
+require "yaml"
+
+buffer = []
+STDIN.each_line { |l| buffer << l }
+
+contexts = YAML::load(buffer.join("\n"))
+
+contexts.each do |context,specifications|
+  puts ""
+  puts "context \"#{context}\" do"
+  puts ""
+  specifications.each do |specification|
+    puts "  specify \"#{specification}\" do"
+    puts "    violated \"no assertions performed\""
+    puts "  end"
+    puts ""
+  end
+  puts "end"
+end
+