Sha256: 5fbdd5074f2e0709186fdd27aa463f63f50c97d96a920a68ddcb9ed4c3cb9e83

Contents?: true

Size: 1.09 KB

Versions: 40

Compression:

Stored size: 1.09 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

40 entries across 40 versions & 4 rubygems

Version Path
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/spec/gherkin/gherkin_spec.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/spec/gherkin/gherkin_spec.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/spec/gherkin/gherkin_spec.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/spec/gherkin/gherkin_spec.rb
cucumber-gherkin-23.0.1 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-23.0.0 spec/gherkin/gherkin_spec.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-gherkin-22.0.0/spec/gherkin/gherkin_spec.rb
cucumber-gherkin-22.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-21.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-20.0.1 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-20.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-19.0.3 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-19.0.2 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-19.0.1 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-19.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-18.1.1 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-18.1.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-18.0.0 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-17.0.2 spec/gherkin/gherkin_spec.rb
cucumber-gherkin-17.0.1 spec/gherkin/gherkin_spec.rb