Sha256: ceb20609774fa6cb94cbe2fd330d852bf6e9be4c159d3cd04ae705123e492e42

Contents?: true

Size: 434 Bytes

Versions: 2

Compression:

Stored size: 434 Bytes

Contents

require 'spec_helper'

describe ConsoleFormatter do
  it 'renders prepared records with help of Hirb library' do
    format = stub(:format, :keys => stub(:format_keys))
    records = stub(:records)

    formatter = ConsoleFormatter.new(format)
    formatter.stub(:render_each => records)

    Hirb::Helpers::AutoTable.should_receive(:render).with(records, fields: format.keys, resize: false)

    formatter.present(records)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
techcor-0.0.10 spec/lib/console_formatter_spec.rb
techcor-0.0.9 spec/lib/console_formatter_spec.rb