黄瓜和定制RSpec匹配器 [英] Cucumber and custom RSpec matchers

查看:337
本文介绍了黄瓜和定制RSpec匹配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为黄瓜写一个自定义RSpec匹配器。我需要cucumber / rails / rspec env.rb,但我仍然得到未初始化的常量Spec :: Matchers的错误。我使用最新版本的Rspec,Cucumber和CucumberRails。我缺少什么?

I'm trying to write a custom RSpec matcher for cucumber. I require cucumber/rails/rspec in env.rb, but I still get "uninitialized constant Spec::Matchers" error. I'm using latest versions of Rspec, Cucumber and CucumberRails. What am I missing?

相同的匹配器与纯RSpec工作正常...

P.S. Same matcher works fine with pure RSpec...

推荐答案

正确的常数现在是 RSpec :: Matchers 。定义在 rspec / matchers

Are you using RSpec 2? The correct constant is now RSpec::Matchers for that. Defined in rspec/matchers.

如果你不是,那么也许你不需要 spec / matchers ,其定义RSpec的 Spec :: Matchers 常数< 2。

If you're not, then perhaps you haven't required spec/matchers which defines the Spec::Matchers constant for RSpec < 2.

这篇关于黄瓜和定制RSpec匹配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆