Sha256: 94ae6c5fefd3f97ce338b04f10ef445f1d4e7b9abdcddad92577f9cda9d3d441

Contents?: true

Size: 845 Bytes

Versions: 4

Compression:

Stored size: 845 Bytes

Contents

require 'spec_helper'
module Alf
  describe Renderer do

    subject{ Renderer }

    let(:input){ [{:a => 1}] }

    it { should respond_to(:rash) }
    it { should respond_to(:text) }
    it { should respond_to(:csv)  }
    it { should respond_to(:yaml) }

    describe 'renderer' do
      subject{ Renderer.renderer(:rash, []) }

      it{ should be_a(Renderer) }
    end

    describe 'rash' do
      subject{ Renderer.rash(input) }

      it{ should be_a(Renderer::Rash) }
    end

    describe 'rash --pretty' do
      subject{ Renderer.rash(input, {pretty: true}) }

      it{ should be_a(Renderer::Rash) }

      it 'should have correct options' do
        subject.options.should eq(pretty: true)
      end
    end

    describe 'text' do
      subject{ Renderer.text(input) }

      it{ should be_a(Renderer::Text) }
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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