Describe the bug
Due to the commit 951bdd3a48900e24d528f0ac65814e2a06dbfdb5 the language support got broken.
We tracked it down to the exact (missing) change, but are unable to find the correct way to fix it, because we're unclear why the code was needed before.
let bundle = Bundle(for: Cucumber.self).resolvedForSPM
if let path = bundle.path(forResource: "gherkin-languages", ofType: "json"),
This tries to find the file gherkin-languages but unfortunately since the change resolvedForSPM doesn't work correctly anymore.
Before the change (removing CucumberSwift_ObjC) the method returned Bundle.module. Afterwards it returns just self - thus the parent directory, which doesn't contain the json file.
By changing CucumberSwift/Sources/CucumberSwift/Extensions/BundleExtensions.swift to this:
Describe the bug Due to the commit 951bdd3a48900e24d528f0ac65814e2a06dbfdb5 the language support got broken. We tracked it down to the exact (missing) change, but are unable to find the correct way to fix it, because we're unclear why the code was needed before.
CucumberSwift/Sources/CucumberSwift/Gherkin/Language.swift
This tries to find the file gherkin-languages but unfortunately since the change
resolvedForSPM
doesn't work correctly anymore. Before the change (removing CucumberSwift_ObjC) the method returnedBundle.module
. Afterwards it returns justself
- thus the parent directory, which doesn't contain the json file.By changing CucumberSwift/Sources/CucumberSwift/Extensions/BundleExtensions.swift to this:
... all our tests are working again.
Additional context Add any other context about the problem here.
Example Feature File: