Skip to content

Commit cb22b6c

Browse files
committed
add spec/score/order_spec.rb
1 parent c09bb59 commit cb22b6c

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

spec/score/order_spec.rb

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
require 'spec_helper'
2+
3+
RSpec.describe "Document order in the result", :type => :aruba do
4+
include_context "messages"
5+
include_context "texmf"
6+
7+
context "for documents with different scores" do
8+
before(:each) { run_texdoc "-lM", "babel" }
9+
10+
let(:res_list_head) do
11+
<<~EXPECTED
12+
babel\t7.0\t#{normalize_path(texmf_dist / "doc/latex/babel/babel.pdf")}\t\tUser guide
13+
babel\t4.0\t#{normalize_path(texmf_dist / "doc/latex/babel/babel-code.pdf")}\t\tCode documentation
14+
EXPECTED
15+
end
16+
17+
it "should be ordered by the scores" do
18+
expect(stdout).to start_with(res_list_head)
19+
end
20+
end
21+
22+
context "for documents with the same scores and different extentions" do
23+
before(:each) { run_texdoc "-lM", "texlive-en" }
24+
25+
let(:res_list_head) do
26+
<<~EXPECTED
27+
texlive-en\t10.0\t#{normalize_path(texmf_dist / "doc/texlive/texlive-en/texlive-en.pdf")}\t\t
28+
texlive-en\t10.0\t#{normalize_path(texmf_dist / "doc/texlive/texlive-en/texlive-en.html")}\t\t
29+
EXPECTED
30+
end
31+
32+
it "should be ordered by the extention position" do
33+
expect(stdout).to start_with(res_list_head)
34+
end
35+
end
36+
end

spec/support/shared_contexts/texmf_context.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
let(:ps_texmf_dist) { SpecHelplers::Texdoc::PS_TEXMF_DIST }
88

99
# the only real TEXMF tree
10-
let(:texmf_dist) { `kpsewhich --var-value TEXMFDIST`.chomp }
10+
let(:texmf_dist) { Pathname(`kpsewhich --var-value TEXMFDIST`.chomp) }
1111

1212
# link to texlive.tlpdb
1313
let(:ps_tlpdb) { SpecHelplers::Texdoc::REPO_TEXLIVE_TLPDB }

0 commit comments

Comments
 (0)