Sha256: 9ec68852c810b0f09e3b3bd2fa58786afe0cf6ab4796b8d133991ae74dd819c1

Contents?: true

Size: 764 Bytes

Versions: 4

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

#
# Copyright (c) 2019-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

require 'spec_helper'

describe Proforma::Modeling::Table::Cell do
  it 'should use defaults for all null attributes' do
    cell = described_class.new

    expect(cell.align).to eq(Proforma::Modeling::Types::Align::LEFT)
    expect(cell.text).to eq('')
    expect(cell.width).to be nil
  end

  it 'should parse width to float if value is not null' do
    expect(described_class.new(width: '34').width).to eq(34.0)
    expect(described_class.new(width: '').width).to eq(0)
    expect(described_class.new(width: '3a4').width).to eq(3.0)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
proforma-1.0.2 spec/proforma/modeling/table/cell_spec.rb
proforma-1.0.1 spec/proforma/modeling/table/cell_spec.rb
proforma-1.0.0 spec/proforma/modeling/table/cell_spec.rb
proforma-1.0.0.pre.alpha spec/proforma/modeling/table/cell_spec.rb