Sha256: 589060f94138fad79fdbc75173e7090ec28cee4bfd7c0c75539afb5ae7323611

Contents?: true

Size: 1.64 KB

Versions: 7

Compression:

Stored size: 1.64 KB

Contents

#encoding: utf-8
module Gherkin
  module Lexer
    shared_examples_for "encoding" do
      describe "with BOM" do
        it "should work just fine" do
          scan_file("with_bom.feature")
          @listener.to_sexp.should == [
            [:feature, "Feature", "Feature Text", "", 1],
            [:scenario, "Scenario", "Reading a Scenario", "", 2],
            [:step, "Given ", "there is a step", 3],
            [:eof]
          ]
        end

        describe "and language specification" do
          it "should work just fine" do
            @lexer = Gherkin::Lexer::I18nLexer.new(@listener)
            scan_file("with_bom_and_language_spec.feature")
            @listener.to_sexp.should == [
              [:comment, "# language: nl", 1], 
              [:feature, "Functionaliteit", "Feature Text", "", 2],
              [:scenario, "Scenario", "Reading a Scenario", "", 3],
              [:step, "Gegeven ", "there is a step", 4],
              [:eof]
            ]
          end
        end

        describe "with ISO-8859-1 encoding" do
          it "should work just fine" do
            @lexer = Gherkin::Lexer::I18nLexer.new(@listener)
            scan_file("iso-8859-1.feature")
            @listener.to_sexp.should == [
              [:comment, "# language: no", 1], 
              [:comment, "# encoding: iSo-8859-1", 2],
              [:feature, "Egenskap", "ISO-8859-1", "", 3],
              [:scenario, "Scenario", "ÆØÅ", "", 4],
              [:step, "Når ", "this is encoded as Latin-1", 5],
              [:step, "Så ", "everything should parse", 6],
              [:eof]
            ]
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/gherkin-2.12.2/spec/gherkin/shared/encoding_group.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/gherkin-2.12.2/spec/gherkin/shared/encoding_group.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/gherkin-2.12.2/spec/gherkin/shared/encoding_group.rb
gherkin-2.12.2 spec/gherkin/shared/encoding_group.rb
gherkin-2.12.2-x86-mswin32 spec/gherkin/shared/encoding_group.rb
gherkin-2.12.2-x86-mingw32 spec/gherkin/shared/encoding_group.rb
gherkin-2.12.2-java spec/gherkin/shared/encoding_group.rb