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