Sha256: e5d47aec467032d359b2131c1280dda885a18377e979d08b5a2561a2f0a58642
Contents?: true
Size: 863 Bytes
Versions: 10
Compression:
Stored size: 863 Bytes
Contents
require 'yaml' require 'json' require 'cucumber/cucumber_expressions/cucumber_expression_tokenizer' require 'cucumber/cucumber_expressions/errors' module Cucumber module CucumberExpressions describe 'Cucumber expression tokenizer' do Dir['testdata/tokens/*.yaml'].each do |testcase| expectation = YAML.load_file(testcase) # encoding? it "#{testcase}" do tokenizer = CucumberExpressionTokenizer.new if expectation['exception'].nil? tokens = tokenizer.tokenize(expectation['expression']) token_hashes = tokens.map{|token| token.to_hash} expect(token_hashes).to eq(JSON.parse(expectation['expected'])) else expect { tokenizer.tokenize(expectation['expression']) }.to raise_error(expectation['exception']) end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems