| CODENOTIFIER | HelpYou are not signed inSign in |
Project: BlueCloth
Revision: 73
Author: ged
Date: 12 May 2005 15:26:33
Diff at Trac: http://www.deveiate.org/projects/BlueCloth/changeset/73
Changes:- Added new tests for bug #17 (two-character bold/italic bug)
- Added new test for bug #12 (Ruby with warnings enabled causes ArgumentError)
| ... | ...@@ -3,7 +3,7 @@ | |
| 3 | 3 | # Unit test for bugs found in BlueCloth |
| 4 | 4 | # $Id$ |
| 5 | 5 | # |
| 6 | # Copyright (c) 2004 The FaerieMUD Consortium. | |
| 6 | # Copyright (c) 2004, 2005 The FaerieMUD Consortium. | |
| 7 | 7 | # |
| 8 | 8 | |
| 9 | 9 | if !defined?( BlueCloth ) || !defined?( BlueCloth::TestCase ) |
| ... | ...@@ -50,6 +50,58 @@ | |
| 50 | 50 | } |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | def test_20_two_character_bold_asterisks | |
| 54 | html = nil | |
| 55 | str = BlueCloth::new( "**aa**" ) | |
| 56 | assert_nothing_raised do | |
| 57 | html = str.to_html | |
| 58 | end | |
| 59 | ||
| 60 | assert_equal "<p><strong>aa</strong></p>", html | |
| 61 | end | |
| 62 | ||
| 63 | def test_21_two_character_bold_underscores | |
| 64 | html = nil | |
| 65 | str = BlueCloth::new( "__aa__" ) | |
| 66 | assert_nothing_raised do | |
| 67 | html = str.to_html | |
| 68 | end | |
| 69 | ||
| 70 | assert_equal "<p><strong>aa</strong></p>", html | |
| 71 | end | |
| 72 | ||
| 73 | def test_22_two_character_emphasis_asterisks | |
| 74 | html = nil | |
| 75 | str = BlueCloth::new( "*aa*" ) | |
| 76 | assert_nothing_raised do | |
| 77 | html = str.to_html | |
| 78 | end | |
| 79 | ||
| 80 | assert_equal "<p><em>aa</em></p>", html | |
| 81 | end | |
| 82 | ||
| 83 | def test_23_two_character_emphasis_underscores | |
| 84 | html = nil | |
| 85 | str = BlueCloth::new( "_aa_" ) | |
| 86 | assert_nothing_raised do | |
| 87 | html = str.to_html | |
| 88 | end | |
| 89 | ||
| 90 | assert_equal "<p><em>aa</em></p>", html | |
| 91 | end | |
| 92 | ||
| 93 | def test_24_ruby_with_warnings_enabled_causes_ArgumentError | |
| 94 | oldverbose = $VERBOSE | |
| 95 | ||
| 96 | assert_nothing_raised do | |
| 97 | $VERBOSE = true | |
| 98 | BlueCloth.new( "*woo*" ).to_html | |
| 99 | end | |
| 100 | ensure | |
| 101 | $VERBOSE = oldverbose | |
| 102 | end | |
| 103 | ||
| 104 | ||
| 53 | 105 | end |
| 54 | 106 | |
| 55 | 107 |