Sha256: 7a5ce8d366da8ea6aaf2b0b863a003be62f2a12be46c98fa32a52c2e84155446

Contents?: true

Size: 545 Bytes

Versions: 4

Compression:

Stored size: 545 Bytes

Contents

shared_examples_for "a Renderer class" do

  it 'should be a subclass of Renderer' do
    subject.ancestors.should include(Alf::Renderer)
  end

  it "has a default mime type" do
    subject.should respond_to(:mime_type)
  end

  describe "an instance" do
    let(:renderer){ subject.new([{id: 1}]) }

    it 'renders and returns a buffer with #execute' do
      buf = ""
      renderer.execute(buf).should be(buf)
    end

    it 'returns a Enumerator with #each without block' do
      renderer.each.should be_a(Enumerator)
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-io/shared_examples/a_renderer_class.rb
alf-core-0.14.0 spec/unit/alf-io/shared_examples/a_renderer_class.rb
alf-core-0.13.1 spec/unit/alf-io/shared_examples/a_renderer_class.rb
alf-core-0.13.0 spec/unit/alf-io/shared_examples/a_renderer_class.rb