Sha256: c54a82ca69d789ae50ab12a9dcb48c3b07e3fa78ffd5fe8cd77fbef0fb68df7f

Contents?: true

Size: 1.1 KB

Versions: 15

Compression:

Stored size: 1.1 KB

Contents

require 'rspec'
require 'gherkin'

describe Gherkin do
  it "can process feature file paths" do
    messages = Gherkin.from_paths(
      ["../testdata/good/minimal.feature"],
      {include_source: true,
       include_gherkin_document: true,
       include_pickles: true}
    ).to_a

    expect(messages.length).to eq(3)
  end

  it "can process feature file content" do
    data = File.open("../testdata/good/minimal.feature", 'r:UTF-8', &:read)

    messages = Gherkin.from_source(
      "uri",
      data,
      {include_source: true,
       include_gherkin_document: true,
       include_pickles: true}
    ).to_a

    expect(messages.length).to eq(3)
  end

  it "can set the default dialect for the feature file content" do
    data = File.open("../testdata/good/i18n_no.feature", 'r:UTF-8', &:read)
    data_without_language_header = data.split("\n")[1..-1].join("\n")

    messages = Gherkin.from_source(
      "uri",
      data,
      {include_source: true,
       include_gherkin_document: true,
       include_pickles: true,
       default_dialect: "no"}
    ).to_a

    expect(messages.length).to eq(3)
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
cucumber-gherkin-28.0.0 spec/gherkin/gherkin_spec.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-gherkin-26.2.0/spec/gherkin/gherkin_spec.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-gherkin-26.2.0/spec/gherkin/gherkin_spec.rb
cucumber-gherkin-27.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-26.2.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-26.1.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-26.0.3 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-26.0.2 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-26.0.1 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-26.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-25.0.2 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-25.0.1 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-25.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-24.1.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-24.0.0 spec/gherkin/gherkin_spec.rb