Sha256: 191b6fa10534324e01252e7e05418fe2d00e22c40e258225d0f2c57b15b63ddd

Contents?: true

Size: 846 Bytes

Versions: 15

Compression:

Stored size: 846 Bytes

Contents

require 'yaml'
require 'cucumber/cucumber_expressions/cucumber_expression_tokenizer'
require 'cucumber/cucumber_expressions/errors'

module Cucumber
  module CucumberExpressions
    describe CucumberExpressionTokenizer do
      Dir['../testdata/cucumber-expression/tokenizer/*.yaml'].each do |path|
        expectation = YAML.load_file(path)
        it "tokenizes #{path}" do
          tokenizer = CucumberExpressionTokenizer.new
          if expectation['exception']
            expect { tokenizer.tokenize(expectation['expression']) }.to raise_error(expectation['exception'])
          else
            tokens = tokenizer.tokenize(expectation['expression'])
            token_hashes = tokens.map{|token| token.to_hash}
            expect(token_hashes).to eq(expectation['expected_tokens'])
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-cucumber-expressions-16.1.2/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-16.1.2 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-16.1.1 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-16.1.0 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-16.0.1 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-16.0.0 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-15.2.0 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-15.1.1 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-15.1.0 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-15.0.2 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
cucumber-cucumber-expressions-15.0.1 spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb