isodoc 1.8.3.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,57 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe IsoDoc::ClassUtils do
4
+ it "cases text" do
5
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans"))
6
+ .to eq "ABC CDE"
7
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn"))
8
+ .to eq "aBC CDE"
9
+ expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn"))
10
+ .to eq "Abc cde"
11
+ expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn"))
12
+ .to eq "ABC cde"
13
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans", firstonly: true))
14
+ .to eq "ABC CDE"
15
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn", firstonly: true))
16
+ .to eq "aBC CDE"
17
+ expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn", firstonly: true))
18
+ .to eq "Abc cde"
19
+ expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn", firstonly: true))
20
+ .to eq "ABC cde"
21
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans", firstonly: false))
22
+ .to eq "ABC CDE"
23
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn", firstonly: false))
24
+ .to eq "aBC cDE"
25
+ expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn", firstonly: false))
26
+ .to eq "Abc Cde"
27
+ expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn", firstonly: false))
28
+ .to eq "ABC CDE"
29
+ end
30
+
31
+ it "cases text with formatting" do
32
+ expect(::IsoDoc::Common
33
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Hans"))
34
+ .to eq "<a>ABC</a> CDE"
35
+ expect(::IsoDoc::Common
36
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Latn"))
37
+ .to eq "<a>aBC</a> CDE"
38
+ expect(::IsoDoc::Common
39
+ .case_with_markup("<a>abc</a> cde", "capital", "Latn"))
40
+ .to eq "<a>Abc</a> cde"
41
+ expect(::IsoDoc::Common
42
+ .case_with_markup("<a>abc</a> cde", "allcaps", "Latn"))
43
+ .to eq "<a>ABC</a> cde"
44
+ expect(::IsoDoc::Common
45
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Hans", firstonly: false))
46
+ .to eq "<a>ABC</a> CDE"
47
+ expect(::IsoDoc::Common
48
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Latn", firstonly: false))
49
+ .to eq "<a>aBC</a> cDE"
50
+ expect(::IsoDoc::Common
51
+ .case_with_markup("<a>abc</a> cde", "capital", "Latn", firstonly: false))
52
+ .to eq "<a>Abc</a> Cde"
53
+ expect(::IsoDoc::Common
54
+ .case_with_markup("<a>abc</a> cde", "allcaps", "Latn", firstonly: false))
55
+ .to eq "<a>ABC</a> CDE"
56
+ end
57
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.3.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-13 00:00:00.000000000 Z
11
+ date: 2022-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -509,6 +509,7 @@ files:
509
509
  - spec/isodoc/section_spec.rb
510
510
  - spec/isodoc/table_spec.rb
511
511
  - spec/isodoc/terms_spec.rb
512
+ - spec/isodoc/utils_spec.rb
512
513
  - spec/isodoc/xref_numbering_spec.rb
513
514
  - spec/isodoc/xref_spec.rb
514
515
  - spec/isodoc/xslfo_convert_spec.rb