File: warning.rb

package info (click to toggle)
ruby-bluefeather 0.41-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 676 kB
  • ctags: 169
  • sloc: ruby: 4,195; makefile: 8
file content (61 lines) | stat: -rw-r--r-- 1,660 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'bluefeather'

describe 'Warning:' do
	before(:all) do
		@bf = BlueFeather::Parser.new
	end
	
	specify "header level" do
		html, rs = @bf.parse_text_with_render_state('###### h6')
		rs.warnings.size.should == 0
		
		html, rs = @bf.parse_text_with_render_state('####### h7')
		rs.warnings.size.should == 1
	end

	
	specify "header id" do
		html, rs = @bf.parse_text_with_render_state('# header # {#legal}')
		rs.warnings.size.should == 0
		
		html, rs = @bf.parse_text_with_render_state('# header # {#99illegal}')
		rs.warnings.size.should == 1

		html, rs = @bf.parse_text_with_render_state('# header # {#ille?gal}')
		rs.warnings.size.should == 1
	end
	
	specify "link id reference" do
		html, rs = @bf.parse_text_with_render_state("[markdown][]\n\n[markdown]: -")
		rs.warnings.size.should == 0

		html, rs = @bf.parse_text_with_render_state("[unknown][]\n\n[markdown]: -")
		rs.warnings.size.should == 1
	end


	
	specify "footnote id" do
		html, rs = @bf.parse_text_with_render_state('[^markdown]: -')
		rs.warnings.size.should == 0

		html, rs = @bf.parse_text_with_render_state('[^mark?down]: -')
		rs.warnings.size.should == 1
	end

	specify "footnote reference" do
		html, rs = @bf.parse_text_with_render_state("[^1]\n\n[^1]: -")
		rs.warnings.size.should == 0
		
		html, rs = @bf.parse_text_with_render_state("[^unknown]")
		rs.warnings.size.should == 1
	end
	
	specify "toc parameter" do
		html, rs = @bf.parse_text_with_render_state("{toc:h2..}")
		rs.warnings.size.should == 0
		
		html, rs = @bf.parse_text_with_render_state("{toc:h21..}")
		rs.warnings.size.should == 1
	end
end