Sha256: 80f685932a3a853e740308b86ff8bdb1969f722ac926d773991051002a2fe8bf

Contents?: true

Size: 666 Bytes

Versions: 12

Compression:

Stored size: 666 Bytes

Contents

require 'spec_helper'

module CiteProc
  module Ruby

    describe 'Renderer#render_macro' do
      let(:renderer) { Renderer.new }

      let(:node) { CSL::Style::Macro.new }

      let(:item) {
        i = CiteProc::CitationItem.new(:id => 'ID-1')
        i.data = CiteProc::Item.new(:id => 'ID-1')
        i
      }

      it 'returns an empty string when empty' do
        expect(renderer.render(item, node)).to eq('')
      end

      it 'renders each child' do
        node << CSL::Style::Text.new(:value => 'foo')
        node << CSL::Style::Text.new(:value => 'bar')

        expect(renderer.render(item, node)).to eq('foobar')
      end

    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
citeproc-ruby-1.1.8 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.7 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.6 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.5 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.4 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.3 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.2 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.1 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.1.0 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.0.6 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.0.5 spec/citeproc/ruby/renderer/macro_spec.rb
citeproc-ruby-1.0.4 spec/citeproc/ruby/renderer/macro_spec.rb