# encoding: utf-8 require 'spec_helper' describe ProxyPac::HTMLTableStyle do it 'produces a table' do data1 = double('DataHTML') allow(data1).to receive(:element).and_return('1st data') allow(data1).to receive(:header).and_return('1st header') allow(data1).to receive(:header_css_class).and_return('header') allow(data1).to receive(:element_css_class).and_return('element') data2 = double('DataHTML') allow(data2).to receive(:element).and_return('2nd data') allow(data2).to receive(:header).and_return('2nd header') allow(data2).to receive(:header_css_class).and_return('header') allow(data2).to receive(:element_css_class).and_return('element') style = ProxyPac::HTMLTableStyle.new(main_container_css_class: 'main_container', element_container_css_class: 'element_container') style.add_data(data1) style.add_data(data2) expected_result = <<-EOS.strip_heredoc.chomp
1st header 2nd header
1st data 2nd data
EOS expect(style.to_s).to eq(expected_result) end end