Skip to content
Permalink
Browse files

Add test for "sentence" case on title and container-title (#2613)

* Add test for "sentence" case on title and container-title
* Remove "sentence" case for title/container-title for more styles
  • Loading branch information...
rmzelle authored and adam3smith committed Apr 2, 2017
1 parent 6f483e4 commit 800c787e0da1cc6589c21d2737f3c8dc5251340d
@@ -187,7 +187,7 @@
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=". ">
<text variable="title" form="long" font-style="italic" text-case="sentence"/>
<text variable="title" form="long" font-style="italic"/>
<text variable="volume" prefix="vol. " form="long" font-style="italic"/>
<text macro="edition_book"/>
<text macro="publisher_book"/>
@@ -196,13 +196,13 @@
<else-if type="chapter paper-conference" match="any">
<group delimiter=" ">
<group delimiter=". ">
<text variable="title" form="long" text-case="sentence"/>
<text variable="title" form="long"/>
<group>
<text term="in" form="short" text-case="sentence" suffix=": "/>
<text macro="editor"/>
</group>
<group delimiter=", " font-style="italic">
<text variable="container-title" form="long" font-style="italic" text-case="sentence"/>
<text variable="container-title" form="long" font-style="italic"/>
<text variable="volume" form="long" prefix="vol. " font-style="italic"/>
</group>
<text macro="edition_chapter"/>
@@ -217,23 +217,23 @@
<else-if type="patent">
<group delimiter=", ">
<group delimiter=". ">
<text variable="title" form="long" text-case="sentence"/>
<text variable="title" form="long"/>
<text variable="number" form="long"/>
</group>
<text macro="year-date_patent"/>
</group>
</else-if>
<else-if type="thesis">
<group delimiter=" ">
<text variable="title" form="long" font-style="italic" suffix="." text-case="sentence"/>
<text variable="title" form="long" font-style="italic" suffix="."/>
<text variable="genre" form="long" suffix="," text-case="sentence"/>
<text macro="publisher_thesis" suffix="," text-case="title"/>
<text macro="year-date_thesis"/>
</group>
</else-if>
<else-if type="webpage">
<group delimiter=" ">
<text variable="title" form="long" suffix=". " text-case="sentence"/>
<text variable="title" form="long" suffix=". "/>
<text variable="container-title" form="long" suffix=". " text-case="title"/>
<text macro="access"/>
<text macro="year-date_webpage"/>
@@ -243,7 +243,7 @@
<group delimiter=":">
<group delimiter=" ">
<group delimiter=". ">
<text variable="title" form="long" text-case="sentence"/>
<text variable="title" form="long"/>
<text variable="container-title" form="short" text-case="title" strip-periods="true" font-style="italic"/>
</group>
<group delimiter=";">
@@ -168,7 +168,7 @@
</choose>
</else-if>
<else>
<text variable="title" font-weight="bold" text-case="sentence"/>
<text variable="title" font-weight="bold"/>
</else>
</choose>
</macro>
@@ -179,7 +179,7 @@
<text variable="container-title"/>
</if>
<else>
<text variable="container-title" font-weight="bold" text-case="sentence"/>
<text variable="container-title" font-weight="bold"/>
</else>
</choose>
</macro>
@@ -83,7 +83,7 @@
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis webpage" match="any">
<text variable="title" font-style="italic" text-case="sentence"/>
<text variable="title" font-style="italic"/>
</if>
<else-if type="patent">
<text variable="title" font-style="italic" quotes="false"/>
@@ -71,6 +71,16 @@
end
end

it "must not use sentence case for title and container-title variables" do
style.descendants!.each do |node|
if node.matches?("text")
if node[:'text-case'] == 'sentence'
expect(node[:'variable']).not_to match(/^title|container-title$/)
end
end
end
end

describe "name nodes" do
it "must have valid et-al-min and et-al-use-first attributes" do
style.each_descendant do |node|
@@ -65,7 +65,7 @@
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis webpage" match="any">
<text variable="title" font-style="italic" text-case="sentence"/>
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title" quotes="true"/>

0 comments on commit 800c787

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.