#!/usr/bin/env ruby # encoding: utf-8 BEGIN { require 'pathname' basedir = Pathname.new( __FILE__ ).dirname.parent.parent libdir = basedir + 'lib' extdir = basedir + 'ext' $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir ) $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir ) } require 'spec' require 'bluecloth' require 'spec/lib/helpers' require 'spec/lib/constants' require 'spec/lib/matchers' ##################################################################### ### C O N T E X T S ##################################################################### describe BlueCloth, "blockquotes" do include BlueCloth::TestConstants, BlueCloth::Matchers ### [Blockquotes] # Regular 1-level blockquotes it "wraps sections with an angle-bracket left margin in a blockquote" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation > Email-style angle brackets > are used for blockquotes. ---

Email-style angle brackets are used for blockquotes.

--- end # Nested blockquotes it "supports nested blockquote sections" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation > Email-style angle brackets > are used for blockquotes. > > And, they can be nested. ---

Email-style angle brackets are used for blockquotes.

And, they can be nested.

--- end # Doubled blockquotes it "supports nested blockquote sections even if there's only one multi-level section" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation > > And, they can be nested. ---

And, they can be nested.

--- end # Lazy blockquotes it "wraps sections preceded by an angle-bracket in a blockquote" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. ---

This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.

--- end # Blockquotes containing other markdown elements it "supports other Markdown elements in blockquote sections" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation > ## This is a header. > > 1. This is the first list item. > 2. This is the second list item. > > Here's some example code: > > return shell_exec("echo $input | $markdown_script"); ---

This is a header.

  1. This is the first list item.
  2. This is the second list item.

Here's some example code:

return shell_exec("echo $input | $markdown_script");
		
--- end # Blockquotes with a
 section
	it "supports block-level HTML inside of blockquotes" do
		pending "a fix in Discount" do
			the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
			> The best approximation of the problem is the following code:
			>
			> 
			> foo + bar; foo.factorize; foo.display
			> 
> > This should result in an error on any little-endian platform. > >
- Garrick Mettronne
---

The best approximation of the problem is the following code:

			foo + bar; foo.factorize; foo.display
			

This should result in an error on any little-endian platform.

- Garrick Mettronne
--- end end end