Sha256: 50be935a13137ed23ab55443f0986bf9efebc3b0b509f56c8d30c73f5807a4a9

Contents?: true

Size: 584 Bytes

Versions: 10

Compression:

Stored size: 584 Bytes

Contents

# coding: utf-8

require 'spec_helper'

RSpec.describe TTY::Table::Field, '#new' do
  let(:object) { described_class }

  subject { object.new value }

  context 'with only value' do
    let(:value) { 'foo' }

    it { is_expected.to be_instance_of(object) }

    it { expect(subject.value).to  eql(value) }

    it { expect(subject.height).to eql(1) }
  end

  context 'with hash value' do
    let(:value) { { :value => 'foo' } }

    it { is_expected.to be_instance_of(object) }

    it { expect(subject.value).to eql('foo') }

    it { expect(subject.height).to eql(1) }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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