Sha256: 04472045ffc4dae33effeee9a2bec6687ec21efec25ab81dd42932ae96071d8a

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

SimpleCov.command_name('TableRow') unless RUBY_VERSION.to_s < '1.9.0'

describe 'TableRow, Unit' do

  clazz = CucumberAnalytics::TableRow

  it_should_behave_like 'a nested element', clazz
  it_should_behave_like 'a bare bones element', clazz
  it_should_behave_like 'a prepopulated element', clazz
  it_should_behave_like 'a sourced element', clazz
  it_should_behave_like 'a raw element', clazz

  it 'can be parsed from stand alone text' do
    source = '| a | row |'

    expect { @element = clazz.new(source) }.to_not raise_error

    # Sanity check in case instantiation failed in a non-explosive manner
    @element.cells.should == ['a', 'row']
  end

  before(:each) do
    @row = clazz.new
  end

  it 'has cells' do
    @row.should respond_to(:cells)
  end

  it 'can get and set its cells' do
    @row.cells = :some_cells
    @row.cells.should == :some_cells
    @row.cells = :some_other_cells
    @row.cells.should == :some_other_cells
  end

  it 'starts with no cells' do
    @row.cells.should == []
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber_analytics-1.4.2 spec/unit/table_row_unit_spec.rb
cucumber_analytics-1.4.1 spec/unit/table_row_unit_spec.rb
cucumber_analytics-1.4.0 spec/unit/table_row_unit_spec.rb