cucumber将字符串转换为整数?

cucumber将字符串转换为整数?,cucumber,bdd,gherkin,Cucumber,Bdd,Gherkin,我正在做一些BDD,但我遇到了一个无法解决的问题。 我试着把它写成我的小黄瓜线,在步骤定义中可见: When the user has 2 overdue books where the fine is payed (fine is 0) 但是,这篇文章的目的是 the user has {int} overdue books where the fine is payed \\(fine is {int}) 我曾尝试在字符前面用反斜杠转义,并将整数字符串化,但这只会将它们转换为字符串。Cu

我正在做一些BDD,但我遇到了一个无法解决的问题。 我试着把它写成我的小黄瓜线,在步骤定义中可见:

When the user has 2 overdue books where the fine is payed (fine is 0)
但是,这篇文章的目的是

the user has {int} overdue books where the fine is payed \\(fine is {int})

我曾尝试在字符前面用反斜杠转义,并将整数字符串化,但这只会将它们转换为字符串。

Cucumber提供了一些有用的建议,它认为您可能希望步骤定义是什么。你没有跟随它的能力。这也是一个有效的cumber表达式:

the user has 0 overdue books where the fine is payed \\(fine is 0)

Cucumber提供了一些有用的建议,它认为您可能希望步骤定义是什么。你没有跟随它的能力。这也是一个有效的cumber表达式:

the user has 0 overdue books where the fine is payed \\(fine is 0)
你期望“罚款是0”中的“0”是什么?你期望“罚款是0”中的“0”是什么?