Sha256: f3fc4affaa6a29c34f0dbe680d8b93ff87509b6b8ea839a8a5220bdc6ea7a26f

Contents?: true

Size: 833 Bytes

Versions: 18

Compression:

Stored size: 833 Bytes

Contents

require 'spec_helper'

module CiteProc
  describe Abbreviate do
    before { Object.class_eval { include Abbreviate } }

    let(:subject) { Object.new }
        
    describe '#abbreviations=' do
      context 'given a hash' do
        let(:abbrev) { Hash[:foo, :bar] }
        it 'uses the hash as the new set of abbreviations' do
          subject.abbreviations = abbrev
          subject.abbreviations.should == abbrev
          subject.abbreviations.should_not equal(abbrev)
        end
      end
      
      context 'given a string' do
        let(:abbrev) { '{"foo":"bar"}' }
        it 'uses the hash as the new set of abbreviations' do
          subject.abbreviations = abbrev
          subject.abbreviations.should == Hash[:foo,'bar']
        end
      end
    end
    
    describe '#abbreviate' do
    end
    
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
citeproc-1.0.0 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre12 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre11 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre10 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre9 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre8 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre7 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre6 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre5 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre4 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre3 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre2 spec/citeproc/abbreviate_spec.rb
citeproc-1.0.0.pre1 spec/citeproc/abbreviate_spec.rb
citeproc-0.0.9 spec/citeproc/abbreviate_spec.rb
citeproc-0.0.8 spec/citeproc/abbreviate_spec.rb
citeproc-0.0.6 spec/citeproc/abbreviate_spec.rb
citeproc-0.0.3 spec/citeproc/abbreviate_spec.rb
citeproc-0.0.2 spec/citeproc/abbreviate_spec.rb