Sha256: 04fdc3e8fbc56ce43b0006e76a6f6cccecf6a1bdabd5ba99fa36d50ccff896a6
Contents?: true
Size: 1.08 KB
Versions: 15
Compression:
Stored size: 1.08 KB
Contents
require 'yaml' require 'cucumber/cucumber_expressions/cucumber_expression' require 'cucumber/cucumber_expressions/parameter_type_registry' module Cucumber module CucumberExpressions describe CucumberExpression do Dir['../testdata/cucumber-expression/transformation/*.yaml'].each do |path| expectation = YAML.load_file(path) it "transforms #{path}" do parameter_registry = ParameterTypeRegistry.new if expectation['exception'] expect { cucumber_expression = CucumberExpression.new(expectation['expression'], parameter_registry) cucumber_expression.match(expectation['text']) }.to raise_error(expectation['exception']) else cucumber_expression = CucumberExpression.new(expectation['expression'], parameter_registry) matches = cucumber_expression.match(expectation['text']) values = matches.nil? ? nil : matches.map { |arg| arg.value(nil) } expect(values).to eq(expectation['expected_args']) end end end end end end
Version data entries
15 entries across 15 versions & 3 rubygems