|
11 | 11 | }
|
12 | 12 | before(:each) { run_texdoc "-dtexdocs", "listings" }
|
13 | 13 |
|
| 14 | + let(:tree_prefix) { normalize_path("path/to/") } |
| 15 | + |
14 | 16 | it "should be properly interpreted" do
|
15 | 17 | expect(stderr).to include(
|
16 | 18 | debug_line "texdocs",
|
17 |
| - "texdocs[4] = path/to/tree4 (index_mandatory=false, recursion_allowed=false)") |
| 19 | + "texdocs[4] = #{tree_prefix}tree4 (index_mandatory=false, recursion_allowed=false)") |
18 | 20 | expect(stderr).to include(
|
19 | 21 | debug_line "texdocs",
|
20 |
| - "texdocs[3] = path/to/tree3 (index_mandatory=false, recursion_allowed=true)") |
| 22 | + "texdocs[3] = #{tree_prefix}tree3 (index_mandatory=false, recursion_allowed=true)") |
21 | 23 | expect(stderr).to include(
|
22 | 24 | debug_line "texdocs",
|
23 |
| - "texdocs[2] = path/to/tree2 (index_mandatory=true, recursion_allowed=false)") |
| 25 | + "texdocs[2] = #{tree_prefix}tree2 (index_mandatory=true, recursion_allowed=false)") |
24 | 26 | expect(stderr).to include(
|
25 | 27 | debug_line "texdocs",
|
26 |
| - "texdocs[1] = path/to/tree1 (index_mandatory=true, recursion_allowed=true)") |
| 28 | + "texdocs[1] = #{tree_prefix}tree1 (index_mandatory=true, recursion_allowed=true)") |
27 | 29 | end
|
28 | 30 | end
|
29 | 31 |
|
|
33 | 35 | let(:texmf_dist_regex) { Regexp.escape(normalize_path(`kpsewhich -var-value TEXMFDIST`.chomp)) }
|
34 | 36 | let(:texmf_home_regex) { Regexp.escape(normalize_path(texmf_home)) }
|
35 | 37 |
|
| 38 | + let(:path_doc_suffix_regex) { Regexp.escape(normalize_path("/doc")) } |
| 39 | + let(:shift_doc_suffix_regex) { Regexp.escape(normalize_path("doc/")) } |
| 40 | + |
36 | 41 | let(:texdocs_n_dist) {
|
37 |
| - /texdocs\[(\d+?)\] = #{texmf_dist_regex}\/doc/.match(stderr).to_a.values_at(1)[0].to_i |
| 42 | + /texdocs\[(\d+?)\] = #{texmf_dist_regex}#{path_doc_suffix_regex}/.match(stderr).to_a.values_at(1)[0].to_i |
38 | 43 | }
|
39 | 44 | let(:texdocs_n_home) {
|
40 |
| - /texdocs\[(\d+?)\] = #{texmf_home_regex}\/doc/.match(stderr).to_a.values_at(1)[0].to_i |
| 45 | + /texdocs\[(\d+?)\] = #{texmf_home_regex}#{path_doc_suffix_regex}/.match(stderr).to_a.values_at(1)[0].to_i |
41 | 46 | }
|
42 | 47 |
|
43 | 48 | it "should search TEXMFDIST using index" do
|
44 |
| - expect(stderr).to match(/texdocs\[#{texdocs_n_dist}\] using index: #{texmf_dist_regex} \(shift=doc\/\)/) |
| 49 | + expect(stderr).to match( |
| 50 | + /texdocs\[#{texdocs_n_dist}\] using index: #{texmf_dist_regex} \(shift=#{shift_doc_suffix_regex}\)/) |
45 | 51 | end
|
46 | 52 |
|
47 | 53 | it "should search TEXMFHOME using file system" do
|
|
0 commit comments