Skip to content

Commit

Permalink
Support 'And' and 'But' annotations in Ruby glue files (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-ryan committed May 18, 2024
1 parent 1910baf commit f08865c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- (Ruby) Support `And` and `But` step definition annotations ([#211](https://github.com/cucumber/language-service/pull/211))

## [1.6.0] - 2024-05-12
### Added
Expand Down
2 changes: 1 addition & 1 deletion src/language/rubyLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const rubyLanguage: Language = {
(regex) @expression
]
)
(#match? @method "(Given|When|Then)$")
(#match? @method "(Given|When|Then|And|But)$")
) @root
`,
],
Expand Down
8 changes: 4 additions & 4 deletions test/language/testdata/ruby/StepDefinitions.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Given('a {uuid}') do |uuid|
end

Given('a {date}') do |date|
When('a {date}') do |date|
end

Given('a {planet}') do |planet|
Then('a {planet}') do |planet|
end

Given(/^a regexp$/) do
And(/^a regexp$/) do
end

Given('an {undefined-parameter}') do |date|
But('an {undefined-parameter}') do |date|
end

Given('the bee\'s knees') do |date|
Expand Down

0 comments on commit f08865c

Please sign in to comment.