Sha256: 2cec3f296e13f803f683461e8df62b913b45b8d5b2b5e0657c734fc1b188991d

Contents?: true

Size: 807 Bytes

Versions: 10

Compression:

Stored size: 807 Bytes

Contents

require 'yaml'
require 'json'
require 'cucumber/cucumber_expressions/cucumber_expression_parser'
require 'cucumber/cucumber_expressions/errors'

module Cucumber
  module CucumberExpressions
    describe 'Cucumber expression parser' do
      Dir['testdata/ast/*.yaml'].each do |testcase|
        expectation = YAML.load_file(testcase) # encoding?
        it "#{testcase}" do
          parser = CucumberExpressionParser.new
          if expectation['exception'].nil?
            node = parser.parse(expectation['expression'])
            node_hash = node.to_hash
            expect(node_hash).to eq(JSON.parse(expectation['expected']))
          else
            expect { parser.parse(expectation['expression']) }.to raise_error(expectation['exception'])
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cucumber-cucumber-expressions-13.0.1 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-12.1.3 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-12.1.2 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-12.1.1 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-12.1.0 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-12.0.1 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-12.0.0 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-11.0.2 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-11.0.1 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb
cucumber-cucumber-expressions-11.0.0 spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb