Sha256: 0e6a1ac4b2b7903322cbade6baa8c499c94f473c674bf4e45c4c92684689ed03

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 KB

Contents

# coding: utf-8

require_relative "../../citation_helper"

describe "citeauthor macro with authoryear style" do
  let(:options) { { "bibliography-tex-style" => "authoryear" } }

  it "formats a single citation" do
    expect(formatted_citation("citeauthor:[Erdos65]", options: options)).
      to eq "Erdős et al."
  end

  it "formats a grouped citation" do
    expect(formatted_citation("citeauthor:[Erdos65]+[Einstein35]", options: options)).
      to eq "Erdős et al.; Einstein et al."
  end

  it "formats a single citation with a prefix" do
    expect(formatted_citation("citeauthor:[Erdos65, prefix=see]", options: options)).
      to eq "see Erdős et al."
  end

  it "formats a single citation with a suffix" do
    expect(formatted_citation("citeauthor:[Erdos65, suffix=new edition]", options: options)).
      to eq "Erdős et al., new edition"
  end

  it "formats a single citation with both a prefix and a suffix" do
    expect(formatted_citation("citeauthor:[Erdos65, prefix=see, suffix=new edition]", options: options)).
      to eq "see Erdős et al., new edition"
  end

  it "formats a single citation with a standard locator" do
    expect(formatted_citation("citeauthor:[Erdos65, page=41-43]", options: options)).
      to eq "Erdős et al., pp. 41-43"
  end

  it "formats a single citation with a custom locator" do
    expect(formatted_citation("citeauthor:[Erdos65, locator=somewhere]", options: options)).
      to eq "Erdős et al., somewhere"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
asciidoctor-bibliography-0.5.0 spec/csl/styles/tex_citeauthor_authoryear_spec.rb
asciidoctor-bibliography-0.5.1 spec/csl/styles/tex_citeauthor_authoryear_spec.rb
asciidoctor-bibliography-0.4.4 spec/csl/styles/tex_citeauthor_authoryear_spec.rb
asciidoctor-bibliography-0.4.3 spec/csl/styles/tex_citeauthor_authoryear_spec.rb
asciidoctor-bibliography-0.4.2 spec/csl/styles/tex_citeauthor_authoryear_spec.rb
asciidoctor-bibliography-0.4.1 spec/csl/styles/tex_citeauthor_authoryear_spec.rb
asciidoctor-bibliography-0.4.0 spec/csl/styles/tex_citeauthor_authoryear_spec.rb