更新时间:2023-11-08 20:42:40
我正在使用黄瓜导轨
gem,这样至少可以做到 defined?(黄瓜)
。如果您正在运行库克,则将返回常数
,如果您正在运行规范,则将返回 nil
。
I'm using the cucumber-rails
gem, and with that at least you can do defined?(Cucumber)
. That will return "constant"
if you're running a cuke or nil
if you're running a spec.