@@ -38,39 +38,6 @@ defmodule ExDoc.Formatter.MARKDOWN.TemplatesTest do
38
38
:ok
39
39
end
40
40
41
- describe "content_template/5" do
42
- test "includes logo as a resource if specified in the config" do
43
- nodes = % { modules: [ ] , tasks: [ ] }
44
-
45
- content =
46
- [ logo: "my_logo.png" ]
47
- |> doc_config ( )
48
- |> Templates . content_template ( nodes , "uuid" , "datetime" , _static_files = [ ] )
49
-
50
- assert content =~ ~S| <item id="logo" href="assets/logo.png" media-type="image/png"/>|
51
- end
52
-
53
-
54
- test "includes modules as a resource" do
55
- module_node = % ExDoc.ModuleNode {
56
- module: XPTOModule ,
57
- doc: nil ,
58
- id: "XPTOModule" ,
59
- title: "XPTOModule"
60
- }
61
-
62
- nodes = % { modules: [ module_node ] , tasks: [ ] }
63
-
64
- content =
65
- Templates . content_template ( doc_config ( ) , nodes , "uuid" , "datetime" , _static_files = [ ] )
66
-
67
- assert content =~
68
- ~S| <item id="XPTOModule" href="XPTOModule.md" media-type="application/md+xml" properties="scripted"/>|
69
-
70
- assert content =~ ~S| <itemref idref="XPTOModule"/>|
71
- end
72
- end
73
-
74
41
describe "module_page/2" do
75
42
test "generates only the module name when there's no more info" do
76
43
module_node = % ExDoc.ModuleNode {
@@ -99,11 +66,11 @@ defmodule ExDoc.Formatter.MARKDOWN.TemplatesTest do
99
66
~r{ ### .*Example H3 heading.*} ms
100
67
101
68
assert content =~
102
- ~r{ moduledoc.*Example.*<samp class="nc"> CompiledWithDocs</samp><samp class="o"> \. </samp><samp class="n"> example</samp> .*} ms
69
+ ~r{ moduledoc.*Example.*CompiledWithDocs\. example.*} ms
103
70
104
- assert content =~ ~r{ example/2.* Some example} ms
105
- assert content =~ ~r{ example_without_docs/0 .*} ms
106
- assert content =~ ~r{ example_1/0 .*> \( macro\) } ms
71
+ assert content =~ ~r{ Some example} ms
72
+ assert content =~ ~r{ example_without_docs() .*} ms
73
+ assert content =~ ~r{ example_1() .*> \( macro\) } ms
107
74
108
75
assert content =~ ~s{ example(foo, bar \\ \\ Baz)}
109
76
end
@@ -121,21 +88,20 @@ defmodule ExDoc.Formatter.MARKDOWN.TemplatesTest do
121
88
assert content =~ ~r{ .*Legacy} ms
122
89
end
123
90
124
-
125
91
## BEHAVIOURS
126
92
127
93
test "outputs behavior and callbacks" do
128
94
content = get_module_page ( [ CustomBehaviourOne ] )
129
95
130
96
assert content =~
131
- ~r{ # \s * CustomBehaviourOne\s * behaviour\s * } m
97
+ ~r{ # CustomBehaviourOne \( behaviour\) } m
132
98
133
99
assert content =~ ~r{ Callbacks}
134
100
135
101
content = get_module_page ( [ CustomBehaviourTwo ] )
136
102
137
103
assert content =~
138
- ~r{ # \s * CustomBehaviourTwo\s * behaviour\s * } m
104
+ ~r{ # CustomBehaviourTwo \( behaviour\) } m
139
105
140
106
assert content =~ ~r{ Callbacks}
141
107
end
@@ -144,14 +110,14 @@ defmodule ExDoc.Formatter.MARKDOWN.TemplatesTest do
144
110
145
111
test "outputs the protocol type" do
146
112
content = get_module_page ( [ CustomProtocol ] )
147
- assert content =~ ~r{ # \s * CustomProtocol\s * protocol\s * } m
113
+ assert content =~ ~r{ # CustomProtocol \( protocol\) } m
148
114
end
149
115
150
116
## TASKS
151
117
152
118
test "outputs the task type" do
153
119
content = get_module_page ( [ Mix.Tasks.TaskWithDocs ] )
154
- assert content =~ ~r{ # \s *mix task_with_docs\s * } m
120
+ assert content =~ ~r{ #\s *mix task_with_docs} m
155
121
end
156
122
end
157
123
end
0 commit comments