Решение на Пета задача от Мария Матева
Обратно към всички решения
Към профила на Мария Матева
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 37 успешни тест(а)
- 20 неуспешни тест(а)
Код
Лог от изпълнението
..F....F....F..F.FF....F.F.....F......F.FF.FFF..F.FFF...F
Failures:
1) Formatter paragraphs renders multiline paragraps
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
TypeError:
can't convert nil into String
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `+'
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `apply_rule'
# /tmp/d20111129-16859-yd77gv/solution.rb:29:in `block in apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `each'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:10:in `to_html'
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:45:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) Formatter headers renders tricky ones
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<h2>Leading wsp</h2>"
got: "## Leading wsp"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:665:in `block in expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `each'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:106:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) Formatter code blocks renders multiple ones
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<pre><code>First code-block</code></pre>\n\n<pre><code>Second block of code</code></pre>"
got: "<pre><code>First code-block\n\nSecond block of code</code></pre>"
(compared using ==)
Diff:
@@ -1,4 +1,4 @@
-<pre><code>First code-block</code></pre>
+<pre><code>First code-block
-<pre><code>Second block of code</code></pre>
+Second block of code</code></pre>
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:156:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) Formatter code blocks renders properly with mixed content
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<h1>This is a header</h1>\n\n<p>Some parahraphs here</p>\n\n<pre><code>Some clean code\nWhich is also beautiful\nAnd maybe also compiles!</code></pre>\n\n<p>More paragraphs there?</p>"
got: "<pre><code><h1>This is a header</h1>\n\n<p>Some parahraphs here</p>\n\nSome clean code\nWhich is also beautiful\nAnd maybe also compiles!\n\n<p>More paragraphs there?</p></code></pre>"
(compared using ==)
Diff:
@@ -1,10 +1,10 @@
-<h1>This is a header</h1>
+<pre><code><h1>This is a header</h1>
<p>Some parahraphs here</p>
-<pre><code>Some clean code
+Some clean code
Which is also beautiful
-And maybe also compiles!</code></pre>
+And maybe also compiles!
-<p>More paragraphs there?</p>
+<p>More paragraphs there?</p></code></pre>
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:214:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) Formatter blockquotes renders multiline ones
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
TypeError:
can't convert nil into String
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `+'
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `apply_rule'
# /tmp/d20111129-16859-yd77gv/solution.rb:102:in `block in blockquotes_rule'
# /tmp/d20111129-16859-yd77gv/solution.rb:56:in `call'
# /tmp/d20111129-16859-yd77gv/solution.rb:56:in `apply_rule'
# /tmp/d20111129-16859-yd77gv/solution.rb:29:in `block in apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `each'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:10:in `to_html'
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:236:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) Formatter blockquotes renders multiple ones
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<blockquote><p>First quote.</p></blockquote>\n\n<blockquote><p>Second quote.</p></blockquote>"
got: "<blockquote><p>First quote.</p>\n\n<p>Second quote.</p></blockquote>"
(compared using ==)
Diff:
@@ -1,4 +1,4 @@
-<blockquote><p>First quote.</p></blockquote>
+<blockquote><p>First quote.</p>
-<blockquote><p>Second quote.</p></blockquote>
+<p>Second quote.</p></blockquote>
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:252:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) Formatter links allows multiple links on a single line
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<p>We have <a href=\"some-url\">a first</a> and <a href=\"another-url\">Second</a>.</p>"
got: "<p>We have <a href=\"some-url\">a first</a> and <a href=\"some-url\">a first</a>.</p>"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:286:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) Formatter links does not render them in code blocks
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<pre><code>This one [is a link](in-a-code-block) - keep as-is.</code></pre>"
got: "<pre><code>This one <a href=\"in-a-code-block\">is a link</a> - keep as-is.</code></pre>"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:299:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) Formatter lists does not choke on malformed lists
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
TypeError:
can't convert nil into String
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `+'
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `apply_rule'
# /tmp/d20111129-16859-yd77gv/solution.rb:29:in `block in apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `each'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:10:in `to_html'
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:394:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) Formatter bold and italic text rendering does not render in code blocks
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<pre><code>Some _more words_ _to be_ **emphasized**?</code></pre>"
got: "<pre><code>Some <em>more words</em> <em>to be</em> <strong>emphasized</strong>?</code></pre>"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:459:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
11) Formatter bold and italic text rendering works in list elements
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<ul>\n <li>Some <em>more words</em> <em>to be</em> <strong>emphasized</strong></li>\n</ul>"
got: "<ul>\n <li>Some <em>more words</em> <em>to be</em> <strong>emphasized</strong></li\n</ul>"
(compared using ==)
Diff:
@@ -1,4 +1,4 @@
<ul>
- <li>Some <em>more words</em> <em>to be</em> <strong>emphasized</strong></li>
+ <li>Some <em>more words</em> <em>to be</em> <strong>emphasized</strong></li
</ul>
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:476:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
12) Formatter bold and italic text rendering works in links in list elements
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<ul>\n <li>Some <a href=\"okay\"><em>more words</em> <em>to be</em> <strong>emphasized</strong></a>!</li>\n</ul>"
got: "<ul>\n <li>Some <a href=\"okay\"><em>more words</em> <em>to be</em> <strong>emphasized</strong></a>!</li\n</ul>"
(compared using ==)
Diff:
@@ -1,4 +1,4 @@
<ul>
- <li>Some <a href="okay"><em>more words</em> <em>to be</em> <strong>emphasized</strong></a>!</li>
+ <li>Some <a href="okay"><em>more words</em> <em>to be</em> <strong>emphasized</strong></a>!</li
</ul>
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:487:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
13) Formatter bold and italic text rendering does not allow parial overlapping
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<p>Some <em>more words **to be</em> emphasized**!</p>"
got: "<p>Some _more words **to be_ emphasized**!</p>"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:496:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
14) Formatter bold and italic text rendering allows simple nesting
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<p>Some <em>more words <strong>to be</strong> emphasized</em>!</p>"
got: "<p>Some _more words <strong>to be</strong> emphasized_!</p>"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:501:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
15) Formatter special entities escapes them in paragraphs
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<p>"Black & Decker"!</p>"
got: ""Black & Decker"!"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:665:in `block in expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `each'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:512:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
16) Formatter special entities escapes them in blockquotes
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<blockquote><p>"Black & Decker"!</p></blockquote>"
got: "<blockquote>"Black & Decker"!</blockquote>"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:665:in `block in expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `each'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:530:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
17) Formatter whitespace removes excess leading and trailing whitespace
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<p>Some txt</p>"
got: "Some txt"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:665:in `block in expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `each'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:547:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
18) Formatter whitespace ignores leading and trailing whitespace of lines whenever possible
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<p>A line here</p>"
got: "A line here"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:665:in `block in expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `each'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:555:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
19) Formatter whitespace does not touch trailing whitespace in code blocks
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
expected: "<pre><code>Simple code blk </code></pre>"
got: "<pre><code>Simple code blk</code></pre>"
(compared using ==)
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:665:in `block in expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `each'
# /tmp/d20111129-16859-yd77gv/spec.rb:664:in `expect_transformations'
# /tmp/d20111129-16859-yd77gv/spec.rb:563:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
20) Formatter mixed, complex input renders properly
Failure/Error: Formatter.new(plain).to_html.should eq formatted.strip
TypeError:
can't convert nil into String
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `+'
# /tmp/d20111129-16859-yd77gv/solution.rb:52:in `apply_rule'
# /tmp/d20111129-16859-yd77gv/solution.rb:29:in `block in apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `each'
# /tmp/d20111129-16859-yd77gv/solution.rb:28:in `apply_rules'
# /tmp/d20111129-16859-yd77gv/solution.rb:10:in `to_html'
# /tmp/d20111129-16859-yd77gv/spec.rb:660:in `expect_transformation'
# /tmp/d20111129-16859-yd77gv/spec.rb:655:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.6186 seconds
57 examples, 20 failures
Failed examples:
rspec /tmp/d20111129-16859-yd77gv/spec.rb:28 # Formatter paragraphs renders multiline paragraps
rspec /tmp/d20111129-16859-yd77gv/spec.rb:99 # Formatter headers renders tricky ones
rspec /tmp/d20111129-16859-yd77gv/spec.rb:143 # Formatter code blocks renders multiple ones
rspec /tmp/d20111129-16859-yd77gv/spec.rb:189 # Formatter code blocks renders properly with mixed content
rspec /tmp/d20111129-16859-yd77gv/spec.rb:223 # Formatter blockquotes renders multiline ones
rspec /tmp/d20111129-16859-yd77gv/spec.rb:239 # Formatter blockquotes renders multiple ones
rspec /tmp/d20111129-16859-yd77gv/spec.rb:285 # Formatter links allows multiple links on a single line
rspec /tmp/d20111129-16859-yd77gv/spec.rb:298 # Formatter links does not render them in code blocks
rspec /tmp/d20111129-16859-yd77gv/spec.rb:377 # Formatter lists does not choke on malformed lists
rspec /tmp/d20111129-16859-yd77gv/spec.rb:458 # Formatter bold and italic text rendering does not render in code blocks
rspec /tmp/d20111129-16859-yd77gv/spec.rb:468 # Formatter bold and italic text rendering works in list elements
rspec /tmp/d20111129-16859-yd77gv/spec.rb:479 # Formatter bold and italic text rendering works in links in list elements
rspec /tmp/d20111129-16859-yd77gv/spec.rb:495 # Formatter bold and italic text rendering does not allow parial overlapping
rspec /tmp/d20111129-16859-yd77gv/spec.rb:500 # Formatter bold and italic text rendering allows simple nesting
rspec /tmp/d20111129-16859-yd77gv/spec.rb:509 # Formatter special entities escapes them in paragraphs
rspec /tmp/d20111129-16859-yd77gv/spec.rb:527 # Formatter special entities escapes them in blockquotes
rspec /tmp/d20111129-16859-yd77gv/spec.rb:541 # Formatter whitespace removes excess leading and trailing whitespace
rspec /tmp/d20111129-16859-yd77gv/spec.rb:550 # Formatter whitespace ignores leading and trailing whitespace of lines whenever possible
rspec /tmp/d20111129-16859-yd77gv/spec.rb:558 # Formatter whitespace does not touch trailing whitespace in code blocks
rspec /tmp/d20111129-16859-yd77gv/spec.rb:586 # Formatter mixed, complex input renders properly
История (1 версия и 1 коментар)
Мария обнови решението на 21.11.2011 16:36 (преди около 13 години)