[DRE-commits] [ruby-org] 106/303: Updated tests to catch the fixed list behavior.
Jérémy Bobbio
lunar at alioth.debian.org
Fri Aug 9 17:33:37 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 e8a1f7a7b32c47c7a24a714f67904702786ff555
Author: Brian Dewey <bdewey at gmail.com>
Date: Sat Sep 3 08:26:43 2011 -0700
Updated tests to catch the fixed list behavior.
---
spec/html_examples/lists.html | 8 ++------
spec/line_spec.rb | 26 ++++++++++++++++----------
2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/spec/html_examples/lists.html b/spec/html_examples/lists.html
index f0cbb30..c956701 100644
--- a/spec/html_examples/lists.html
+++ b/spec/html_examples/lists.html
@@ -19,9 +19,5 @@
<p>And this is a <b>separate paragraph.</b> Note the indentation in the org file.</p>
<h2>Invalid lists</h2>
<p>Note that spaces are required to denote lists. Thus, none of the following should get recognized as lists.</p>
-<ul>
- <li>This isn’t a list.</li>
- <li>And this isn’t a list.</li>
- <li>And this isn’t a list.</li>
- <li>And this isn’t a list.</li>
-</ul>
+<p>-This isn’t a list. -And this isn’t a list.</p>
+<p>1.And this isn’t a list. 2.And this isn’t a list.</p>
diff --git a/spec/line_spec.rb b/spec/line_spec.rb
index 9faad61..c0a3e89 100644
--- a/spec/line_spec.rb
+++ b/spec/line_spec.rb
@@ -29,20 +29,26 @@ describe Orgmode::Line do
Orgmode::Line.new(inline_example).inline_example?.should be_true
end
end
-
-
- it "should recognize plain lists" do
- list_formats = ["-",
- "+",
- " -",
- " +",
- " 1.",
- " 2)"]
- list_formats.each do |list|
+
+ list_formats = ["- ",
+ "+ ",
+ " - ",
+ " + ",
+ " 1. ",
+ " 2) "]
+ list_formats.each do |list|
+ it "should recognize this list format: '#{list}'" do
line = Orgmode::Line.new list
line.plain_list?.should be_true
end
end
+
+ ["-foo", "+foo", "1.foo", "2.foo"].each do |invalid_list|
+ it "should not recognize this invalid list: '#{invalid_list}'" do
+ line = Orgmode::Line.new invalid_list
+ line.plain_list?.should_not be_true
+ end
+ end
it "should recognize table rows" do
Orgmode::Line.new("| One | Two | Three |").table_row?.should be_true
--
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