Sha256: 3161a6970fea0f46e9f99d3467bc7fdc8e840cc69ae634f2d9f1774c4f19f9f0
Contents?: true
Size: 823 Bytes
Versions: 5
Compression:
Stored size: 823 Bytes
Contents
# -*- encoding: utf-8 -*- require 'spec_helper' describe TTY::Table::Transformation, '#extract_tuples' do let(:object) { described_class } let(:header) { ['Header1', 'Header2'] } let(:rows) { [['a1', 'a2'], ['b1', 'b2']] } subject { object.extract_tuples(value) } context 'when rows' do let(:value) { [rows] } it { expect(subject[:header]).to be_nil } it { expect(subject[:rows]).to eql(rows) } end context 'when header and rows' do let(:value) { [header, rows] } it { expect(subject[:header]).to eql(header) } it { expect(subject[:rows]).to eql(rows) } end context 'when hash' do let(:value) { [[{'Header1' => ['a1', 'a2'], 'Header2' => ['b1', 'b2'] }]] } it { expect(subject[:header]).to eql(header) } it { expect(subject[:rows]).to eql(rows) } end end
Version data entries
5 entries across 5 versions & 1 rubygems