Sha256: 1b2ac929bed79bf926fdd90c3cb5e2b22592cf7e39429b9ae291b73c0eb5e747
Contents?: true
Size: 572 Bytes
Versions: 9
Compression:
Stored size: 572 Bytes
Contents
# encoding: utf-8 require 'spec_helper' RSpec.describe TTY::Table, '#each' do let(:header) { ['Header1'] } let(:rows) { [['a1'], ['b1']] } subject(:table) { described_class.new(header, rows) } context 'with no block' do it { expect(table.each).to be_instance_of(to_enum.class) } it 'yields the expected values' do expect(table.each.to_a).to eql(table.to_a) end end context 'with block' do it 'yields each row' do yields = [] table.each { |row| yields << row } expect(yields).to eql(table.to_a) end end end
Version data entries
9 entries across 9 versions & 1 rubygems