Sha256: 44802f1cc082a8e72690140fce6873e62b2c304341b5827695f2b97a67c32b9f

Contents?: true

Size: 989 Bytes

Versions: 2

Compression:

Stored size: 989 Bytes

Contents

require 'spec_helper'
module Alf
  describe Renderer do
    
    subject{ Renderer }
    it { should respond_to(:rash) }
    it { should respond_to(:text) }

    describe 'renderer' do
      subject{ Renderer.renderer(:rash) } 
      it{ should be_a(Renderer) }
    end
      
    describe 'rash' do
      subject{ Renderer.rash(input) } 
      let(:input){ [{:a => 1}] }
      let(:output){ "" }
      let(:expected){ "{:a => 1}\n" }
      specify{ 
        subject.should be_a(Renderer)
        subject.execute(output).should == expected
      }
    end
    
    describe 'text' do
      subject{ Renderer.text(input) } 
      let(:input){ [{:a => 1}] }
      let(:output){ "" }
      let(:expected){ "+----+\n"\
                      "| :a |\n"\
                      "+----+\n"\
                      "|  1 |\n"\
                      "+----+\n"
      }
      specify{ 
        subject.should be_a(Renderer)
        subject.execute(output).should == expected
      }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-0.10.0 spec/unit/test_renderer.rb
alf-0.9.3 spec/unit/test_renderer.rb