Sha256: 0c2c4bd448971349d47a43410805a55be2f542cfcb19afce95393f84cd39ce97

Contents?: true

Size: 1.75 KB

Versions: 61

Compression:

Stored size: 1.75 KB

Contents

component extends="testbox.system.BaseSpec" {

	function beforeAll(){
	  SUT = createObject( 'Markdown' );
	}

	function run(){
	
		describe( "My Markdown class", function(){			

			it( 'parses normal text as a paragraph', function(){
				expect( SUT.parse( input='This will be a paragraph' ) ).toBe( '<p>This will be a paragraph</p>' );
			});

			it( 'parsing italics', function(){
				expect( SUT.parse( input='_This will be italic_' ) ).toBe( '<p><em>This will be italic</em></p>' );
			});

			it( 'parsing bold text', function(){
				expect( SUT.parse( input='__This will be bold__' ) ).toBe( '<p><strong>This will be bold</strong></p>' );
			});

			it( 'mixed normal, italics and bold text', function(){
				expect( SUT.parse( input='This will _be_ __mixed__' ) ).toBe( '<p>This will <em>be</em> <strong>mixed</strong></p>' );
			});

			it( 'with h1 header level', function(){
				expect( SUT.parse( input='## This will be an h1' ) ).toBe( '<h1>This will be an h1</h1>' );
			});

			it( 'with h2 header level', function(){
				expect( SUT.parse( input='#### This will be an h2' ) ).toBe( '<h2>This will be an h2</h2>' );
			});

			it( 'with h6 header level', function(){
				expect( SUT.parse( input='############ This will be an h6' ) ).toBe( '<h6>This will be an h6</h6>' );
			});

			it( 'unordered lists', function(){
				expect( SUT.parse( input='* Item 1#chr( 10 )#* Item 2' ) ).toBe( '<ul><li><p>Item 1</p></li><li><p>Item 2</p></li></ul>' );
			});

			it( 'With a little bit of everything', function(){
				expect( SUT.parse( input='## Header!#chr( 10 )#* __Bold Item__#chr( 10 )#* _Italic Item_' ) ).toBe( '<h1>Header!</h1><ul><li><strong>Bold Item</strong></li><li><em>Italic Item</em></li></ul>' );
			});

		});
		
	}
 
}

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
trackler-2.2.1.104 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.103 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.102 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.101 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.100 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.99 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.98 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.97 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.96 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.95 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.94 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.93 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.92 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.91 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.90 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.89 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.88 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.87 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.86 tracks/cfml/exercises/markdown/MarkdownTest.cfc
trackler-2.2.1.85 tracks/cfml/exercises/markdown/MarkdownTest.cfc