Sha256: 42c035af3cb64655e530efc974e5e63ca5b482ebd3046ada78cfccdbeb9ae9c3

Contents?: true

Size: 768 Bytes

Versions: 12

Compression:

Stored size: 768 Bytes

Contents

require 'rspec'
require 'gherkin/gherkin_line'

describe Gherkin::GherkinLine do
  context '#table_cell' do
    def cells_text(line)
      Gherkin::GherkinLine.new(line, 12).table_cells.map(&:text)
    end

    it 'trims white spaces before cell content' do
      expect(cells_text("|   \t spaces before|")).to eq(['spaces before'])
    end

    it 'trims white spaces after cell content' do
      expect(cells_text("|spaces after   |")).to eq(['spaces after'])
    end

    it 'trims white spaces around cell content' do
      expect(cells_text("|   \t spaces everywhere   \t|")).to eq(['spaces everywhere'])
    end

    it 'does not drop white spaces inside a cell' do
      expect(cells_text("| foo()\n  bar\nbaz |")).to eq(["foo()\n  bar\nbaz"])
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cucumber-gherkin-18.0.0 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-17.0.2 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-17.0.1 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-17.0.0 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-16.0.0 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-15.0.2 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-15.0.1 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-15.0.0 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-14.2.0 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-14.1.0 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-14.0.1 spec/gherkin/gherkin_line_spec.rb
cucumber-gherkin-14.0.0 spec/gherkin/gherkin_line_spec.rb