Sha256: da0d98dcf5181e384823573acee83ea09815710c37c032094d4739a742ac03fd

Contents?: true

Size: 500 Bytes

Versions: 10

Compression:

Stored size: 500 Bytes

Contents

# coding: utf-8

require 'spec_helper'

RSpec.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 { is_expected.to be_instance_of(Hash) }

    it { is_expected.to eql(0 => 'a') }
  end

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

    it { is_expected.to be_instance_of(Hash) }

    it { is_expected.to eql(id: 'a') }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tty-table-0.10.0 spec/unit/row/data_spec.rb
tty-table-0.9.0 spec/unit/row/data_spec.rb
tty-table-0.8.0 spec/unit/row/data_spec.rb
tty-table-0.7.0 spec/unit/row/data_spec.rb
tty-table-0.6.0 spec/unit/row/data_spec.rb
tty-table-0.5.0 spec/unit/row/data_spec.rb
tty-table-0.4.0 spec/unit/row/data_spec.rb
tty-table-0.3.0 spec/unit/row/data_spec.rb
tty-table-0.2.0 spec/unit/row/data_spec.rb
tty-table-0.1.0 spec/unit/row/data_spec.rb