Skip to content

Commit

Permalink
Fix the default arg ctor for ruby Gherkin::Parser. Closes #1074
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Jun 22, 2020
1 parent 77d152f commit 0b7034b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions gherkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt

### Fixed

* [Ruby] Fix the default constructor of `Gherkin::Parser`
([#1074](https://github.com/cucumber/cucumber/issues/1074)
[aslakhellesoy])
* [Ruby] Use `require_relative` for internal requires ([#1010](https://github.com/cucumber/cucumber/pull/1010) [deivid-rodriguez])

## [13.0.0] - 2020-04-14
Expand Down
2 changes: 1 addition & 1 deletion gherkin/ruby/gherkin-ruby.razor
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module Gherkin
class @Model.ParserClassName
attr_accessor :stop_at_first_error

def initialize(ast_builder = AstBuilder.new)
def initialize(ast_builder = AstBuilder.new(Cucumber::Messages::IdGenerator::UUID.new))
@@ast_builder = ast_builder
end

Expand Down
2 changes: 1 addition & 1 deletion gherkin/ruby/lib/gherkin/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def initialize(token_scanner, token_matcher, token_queue, errors)
class Parser
attr_accessor :stop_at_first_error

def initialize(ast_builder = AstBuilder.new)
def initialize(ast_builder = AstBuilder.new(Cucumber::Messages::IdGenerator::UUID.new))
@ast_builder = ast_builder
end

Expand Down
10 changes: 10 additions & 0 deletions gherkin/ruby/spec/gherkin/parser_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'rspec'
require 'gherkin'

describe Gherkin::Parser do
context '.new' do
it 'can be invoked with no args' do
Gherkin::Parser.new
end
end
end

0 comments on commit 0b7034b

Please sign in to comment.