Sha256: 5698fe716e2cc0aca764a467faa51e3eb105d06d6ccb9fd63ae45b098315265c

Contents?: true

Size: 475 Bytes

Versions: 4

Compression:

Stored size: 475 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'spec_helper'

describe TTY::Table::Row, '#data' do
  let(:object) { described_class.new data, header }
  let(:data) { ['a'] }

  subject { object.to_hash }

  context 'without attributes' do
    let(:header) { nil }

    it { should be_instance_of(Hash) }

    it { should eql(0 => 'a') }
  end

  context 'with attributes' do
    let(:header) { [:id] }

    it { should be_instance_of(Hash) }

    it { should eql(:id => 'a') }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tty-0.0.11 spec/tty/table/row/data_spec.rb
tty-0.0.10 spec/tty/table/row/data_spec.rb
tty-0.0.9 spec/tty/table/row/data_spec.rb
tty-0.0.8 spec/tty/table/row/data_spec.rb