Skip to content

Commit

Permalink
Fix failing tests caused by API renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgramFan committed Feb 13, 2020
1 parent d1d1580 commit 8d0c710
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/citation_macro_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

describe AsciidoctorBibtex do
it 'should extract a simple citation from text' do
cites = CitationMacro.extract_citations 'some text cite:[author12] more text'
cites = CitationMacro.extract_macros 'some text cite:[author12] more text'
cites.size.must_equal 1
cites[0].items[0].key.must_equal 'author12'
end

it 'should extract combinations of citations from text' do
cites = CitationMacro.extract_citations 'some text cite:[author12,another11] more text'
cites = CitationMacro.extract_macros 'some text cite:[author12,another11] more text'
cites.size.must_equal 1
cites[0].items.size.must_equal 2
cites[0].items[0].key.must_equal 'author12'
cites[0].items[1].key.must_equal 'another11'
end

it 'should extract separate groups of citations' do
cites = CitationMacro.extract_citations 'some text cite:[author12,another11] more text cite:[third10]'
cites = CitationMacro.extract_macros 'some text cite:[author12,another11] more text cite:[third10]'
cites.size.must_equal 2
cites[0].items.size.must_equal 2
cites[1].items.size.must_equal 1
Expand All @@ -35,7 +35,7 @@
end

it 'should extract citations with page numbers' do
cites = CitationMacro.extract_citations 'some text citenp:[author12(1-20),another11(15)]'
cites = CitationMacro.extract_macros 'some text citenp:[author12(1-20),another11(15)]'
cites.size.must_equal 1
cites.first.items.size.must_equal 2
cites.first.items[0].key.must_equal 'author12'
Expand All @@ -46,7 +46,7 @@
end

it 'should extract page numbers as well as refs' do
cites = CitationMacro.extract_citations 'citenp:[author12,another11(15-30),third10(14)]'
cites = CitationMacro.extract_macros 'citenp:[author12,another11(15-30),third10(14)]'
cites.size.must_equal 1
cites.first.items.size.must_equal 3
cites.first.items[0].key.must_equal 'author12'
Expand All @@ -58,7 +58,7 @@
end

it 'should work with dash in citation' do
cites = CitationMacro.extract_citations 'cite:[some-author]'
cites = CitationMacro.extract_macros 'cite:[some-author]'
cites.size.must_equal 1
cites.first.items[0].key.must_equal 'some-author'
end
Expand Down
2 changes: 1 addition & 1 deletion test/formats_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def check_complete_citation style, line, result, links = false
p = Processor.new 'test/data/test.bib', links, style
p.process_citation_macros(line)
p.build_citation_text(CitationMacro.extract_citations(line).first).must_equal result
p.build_citation_text(CitationMacro.extract_macros(line).first).must_equal result
end

it "must handle chicago style references with 'cite'" do
Expand Down

0 comments on commit 8d0c710

Please sign in to comment.