riboseinc / asciidoctor-bibliography

Citations in AsciiDoc
MIT License
30 stars 8 forks source link

Updating the gem #118

Closed ronaldtse closed 2 years ago

ronaldtse commented 2 years ago

This PR:

ronaldtse commented 2 years ago

The current failures are real:

Failures:

  1) an asciidoctor document with bibliography usage generates the correct mla bibliography
     Failure/Error:
       expect(document.catalog[:refs]["_bibliography"].blocks[1].lines[0]).
         to include("Dommering, E., et al.")

       expected "{empty}anchor:bibliography-default-dommering_internet:_2015[]Roberts, Larry. _The Arpanet and Computer Networks_. ACM, 1986, pp.51–58." to include "Dommering, E., et al."
     # ./spec/end_to_end_spec.rb:51:in `block (2 levels) in <top (required)>'

  2) cite macro with apa style formats a complex citation
     Failure/Error:
       expect(formatted_citation("cite:[Erdos65, prefix=see]+[Einstein35, page=41-43]",
                                 options: { "bibliography-style" => "apa",
                                            "bibliography-database" => "database.bib",
                                            "bibliography-hyperlinks" => "true" })).
         to eq "(<<bibliography-default-Einstein35,Einstein, Podolsky, & Rosen, 1935, pp. 41-43>>; " +
         "<<bibliography-default-Erdos65,seeErdős, Heyting, & Brouwer, 1965>>)"

       expected: "(<<bibliography-default-Einstein35,Einstein, Podolsky, & Rosen, 1935, pp. 41-43>>; <<bibliography-default-Erdos65,seeErdős, Heyting, & Brouwer, 1965>>)"
            got: "(<<bibliography-default-Einstein35,Einstein et al., 1935, pp. 41-43>>; <<bibliography-default-Erdos65,seeErdős et al., 1965>>)"

       (compared using ==)
     # ./spec/macros_spec.rb:7:in `block (2 levels) in <top (required)>'

  3) cite macro with arbitrary interpolated text formats a complex citation
     Failure/Error:
       expect(formatted_citation("cite:[Erdos65, text=foo {cite} bar]",
                                 options: { "bibliography-style" => "apa",
                                            "bibliography-database" => "database.bib",
                                            "bibliography-hyperlinks" => "true" })).
         to eq "(<<bibliography-default-Erdos65,foo Erdős, Heyting, & Brouwer, 1965 bar>>)"

       expected: "(<<bibliography-default-Erdos65,foo Erdős, Heyting, & Brouwer, 1965 bar>>)"
            got: "(<<bibliography-default-Erdos65,foo Erdős et al., 1965 bar>>)"

       (compared using ==)
     # ./spec/macros_spec.rb:18:in `block (2 levels) in <top (required)>'

  4) cite macro using more than two keys formats all cited keys
     Failure/Error:
       expect(formatted_citation("cite:[Lane12a]+[Lane12b]+[Erdos65]+[Einstein35]",
                                 options: { "bibliography-style" => "apa",
                                            "bibliography-database" => "database.bib",
                                            "bibliography-hyperlinks" => "true" })).
         to eq "(<<bibliography-default-Einstein35,Einstein, Podolsky, & Rosen, 1935>>; <<bibliography-default-Erdos65,Erdős, Heyting, & Brouwer, 1965>>; <<bibliography-default-Lane12a,Lane, 2000>>; <<bibliography-default-Lane12b,Mane & Smith, 2000>>)"

       expected: "(<<bibliography-default-Einstein35,Einstein, Podolsky, & Rosen, 1935>>; <<bibliography-default-Erdos...; <<bibliography-default-Lane12a,Lane, 2000>>; <<bibliography-default-Lane12b,Mane & Smith, 2000>>)"
            got: "(<<bibliography-default-Einstein35,Einstein et al., 1935>>; <<bibliography-default-Erdos65,Erdős et ...; <<bibliography-default-Lane12a,Lane, 2000>>; <<bibliography-default-Lane12b,Mane & Smith, 2000>>)"

       (compared using ==)
     # ./spec/macros_spec.rb:47:in `block (2 levels) in <top (required)>'

Finished in 11.85 seconds (files took 0.70092 seconds to load)
250 examples, 4 failures

Failed examples:

rspec ./spec/end_to_end_spec.rb:48 # an asciidoctor document with bibliography usage generates the correct mla bibliography
rspec ./spec/macros_spec.rb:6 # cite macro with apa style formats a complex citation
rspec ./spec/macros_spec.rb:17 # cite macro with arbitrary interpolated text formats a complex citation
rspec ./spec/macros_spec.rb:46 # cite macro using more than two keys formats all cited keys

The failures are due to the differences in rendering:

These failures are because the author names are explicitly shown instead of "et al.".