[DRE-commits] [ruby-org] 64/303: Changed the parser spec to dynamically generate a different rspec example for each test input file. This makes it *much* easier to work with failing test cases.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:28 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit 28df9ae6b28b0d4c66f1e8ac08733a4eccfacde6
Author: Brian Dewey <bdewey at gmail.com>
Date:   Tue Dec 29 20:16:37 2009 -0800

    Changed the parser spec to dynamically generate a different rspec
    example for each test input file. This makes it *much* easier to work
    with failing test cases.
---
 spec/parser_spec.rb |   38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/spec/parser_spec.rb b/spec/parser_spec.rb
index 1c498c8..0da8fbd 100644
--- a/spec/parser_spec.rb
+++ b/spec/parser_spec.rb
@@ -85,15 +85,15 @@ describe Orgmode::Parser do
     parser.to_textile.should be_kind_of(String)
   end
 
-  it "can translate textile files" do
-    data_directory = File.join(File.dirname(__FILE__), "textile_examples")
-    org_files = File.expand_path(File.join(data_directory, "*.org" ))
-    files = Dir.glob(org_files)
-    files.each do |file|
-      basename = File.basename(file, ".org")
-      textile_name = File.join(data_directory, basename + ".textile")
-      textile_name = File.expand_path(textile_name)
-
+  data_directory = File.join(File.dirname(__FILE__), "textile_examples")
+  org_files = File.expand_path(File.join(data_directory, "*.org" ))
+  files = Dir.glob(org_files)
+  files.each do |file|
+    basename = File.basename(file, ".org")
+    textile_name = File.join(data_directory, basename + ".textile")
+    textile_name = File.expand_path(textile_name)
+
+    it "should convert #{basename}.org to Textile" do
       expected = IO.read(textile_name)
       expected.should be_kind_of(String)
       parser = Orgmode::Parser.new(IO.read(file))
@@ -103,15 +103,17 @@ describe Orgmode::Parser do
     end
   end
 
-  it "can translate to html" do
-    data_directory = File.join(File.dirname(__FILE__), "html_examples")
-    org_files = File.expand_path(File.join(data_directory, "*.org" ))
-    files = Dir.glob(org_files)
-    files.each do |file|
-      basename = File.basename(file, ".org")
-      textile_name = File.join(data_directory, basename + ".html")
-      textile_name = File.expand_path(textile_name)
-
+  # Dynamic generation of examples from each *.org file in html_examples.
+  # Each of these files is convertable to HTML.
+  data_directory = File.join(File.dirname(__FILE__), "html_examples")
+  org_files = File.expand_path(File.join(data_directory, "*.org" ))
+  files = Dir.glob(org_files)
+  files.each do |file|
+    basename = File.basename(file, ".org")
+    textile_name = File.join(data_directory, basename + ".html")
+    textile_name = File.expand_path(textile_name)
+
+    it "should convert #{basename}.org to HTML" do
       expected = IO.read(textile_name)
       expected.should be_kind_of(String)
       parser = Orgmode::Parser.new(IO.read(file))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list