Sha256: c2f9955e6d7d27dd63f3d4a6610a4afc8cdc2ad2b0149c79a5d4bd1ad7c3cf39

Contents?: true

Size: 383 Bytes

Versions: 3

Compression:

Stored size: 383 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  subject { object.length }

  context 'with escaped value' do
    let(:value) { "Multi\nLine" }

    it { is_expected.to eql(5) }
  end

  context 'with unescaped value' do
    let(:value) { "Multi\\nLine" }

    it { is_expected.to eql(11) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tty-0.1.2 spec/tty/table/field/length_spec.rb
tty-0.1.1 spec/tty/table/field/length_spec.rb
tty-0.1.0 spec/tty/table/field/length_spec.rb