Sha256: 4ffcb44e618fdeff8eaead59a466ba2d6cad1e14e7072680dc023ab3e0d6ef7a

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

module CSL
  describe Style::Label do

    it { should_not be_names_label }
    it { should_not be_always_pluralize }
    it { should_not be_never_pluralize }

    describe '.terms' do
      Hash[*%w{
        page              page
        issue             issue
        edition           edition
        number-of-pages   page
        number-of-volumes volume
        chapter-number    chapter
      }].each do |variable, term|
        it "returns #{term.inspect} for #{variable.inspect}" do
          Style::Label.terms[variable].should == term
        end
      end
    end

    describe 'a label inside a names node' do
      before(:each) { Style::Names.new << subject }

      it { should be_names_label }
    end

    describe '#term' do
      it { should be_empty }

      it 'returns the term for the current variable' do
        subject[:variable] = 'page'
        subject.term.should == 'page'

        subject[:variable] = 'number-of-volumes'
        subject.term.should == 'volume'
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
csl-1.2.1 spec/csl/style/label_spec.rb
csl-1.2.0 spec/csl/style/label_spec.rb
csl-1.1.0 spec/csl/style/label_spec.rb
csl-1.0.2 spec/csl/style/label_spec.rb
csl-1.0.1 spec/csl/style/label_spec.rb
csl-1.0.0 spec/csl/style/label_spec.rb
csl-1.0.0.pre23 spec/csl/style/label_spec.rb
csl-1.0.0.pre22 spec/csl/style/label_spec.rb