File tree Expand file tree Collapse file tree 3 files changed +8
-17
lines changed
Expand file tree Collapse file tree 3 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -52,15 +52,6 @@ def set_paths(from, to)
5252 } )
5353 end
5454
55- # Redirects without a trailing slash should produce extentionless files
56- def output_ext
57- if File . extname ( permalink ) . empty? && !permalink . end_with? ( "/" )
58- ""
59- else
60- _renderer . output_ext
61- end
62- end
63-
6455 private
6556
6657 def context
Original file line number Diff line number Diff line change 66
77 context "pages" do
88 context "single redirect from" do
9- let ( :relative_path ) { "some/other/path" }
9+ let ( :relative_path ) { "some/other/path.html " }
1010
1111 it "exists in the built site" do
1212 expect ( path ) . to exist
1717 context "multiple redirect froms" do
1818 %w( help contact let-there/be/light-he-said geepers/mccreepin ) . each do |redirect |
1919 context "the #{ redirect } redirect" do
20- let ( :relative_path ) { redirect }
20+ let ( :relative_path ) { " #{ redirect } .html" }
2121
2222 it "exists in the built site" do
2323 expect ( path ) . to exist
4848
4949 context "documents" do
5050 context "a single redirect from" do
51- let ( :relative_path ) { "articles/23128432159832/mary-had-a-little-lamb" }
51+ let ( :relative_path ) { "articles/23128432159832/mary-had-a-little-lamb.html " }
5252
5353 it "exists in the built site" do
5454 expect ( path ) . to exist
Original file line number Diff line number Diff line change 137137 let ( :from ) { "/foo" }
138138
139139 it "adds .html" do
140- expected = File . expand_path "foo" , site . dest
140+ expected = File . expand_path "foo.html " , site . dest
141141 expect ( subject . destination ( "/" ) ) . to eql ( expected )
142142 end
143143 end
154154 context "when redirect from is an HTML file" do
155155 let ( :from ) { "/foo.html" }
156156
157- it "doesn't add .html" do
157+ it "adds .html" do
158158 expected = File . expand_path "foo.html" , site . dest
159159 expect ( subject . destination ( "/" ) ) . to eql ( expected )
160160 end
173173 let ( :from ) { "foo" }
174174
175175 it "adds the slash" do
176- expected = File . expand_path "foo" , site . dest
176+ expected = File . expand_path "foo.html " , site . dest
177177 expect ( subject . destination ( "/" ) ) . to eql ( expected )
178178 end
179179 end
199199 context "with no slash" do
200200 let ( :from ) { "foo" }
201201
202- it "uses no extension " do
203- expect ( subject . output_ext ) . to eql ( "" )
202+ it "uses HTML " do
203+ expect ( subject . output_ext ) . to eql ( ".html " )
204204 end
205205 end
206206 end
You can’t perform that action at this time.
0 commit comments