有人使用Minitest :: Spec进行Rails功能测试吗? [英] Has anyone used Minitest::Spec withing a Rails functional test?

查看:74
本文介绍了有人使用Minitest :: Spec进行Rails功能测试吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Minitest中的规范库很棒.我已经能够在Rails单元测试中使用它了.但是,Rails功能测试继承自ActionController :: TestCase,后者在其设置中提供了诸如@controller之类的实例变量.

The spec library in Minitest is great. I've been able to use it within Rails unit tests no problem. However, Rails functional test inherit from ActionController::TestCase which provides instance variables like @controller in it's setup.

有人在使用Minitest :: Spec库进行Rails功能测试吗?

Has anyone been using the Minitest::Spec lib for their Rails functional tests?

如果没有,我正在考虑创建一个小型库来做到这一点.我不太热衷于rspec,并且Shoulda开始将其重点转移到rspec.拥有一些轻量级的东西并在已经提供的工具上构建是很好的选择.

If not, I'm considering creating a small library to do just that. I'm not too keen on rspec, and shoulda is starting to shift it's focus to rspec. It would be nice to have something lightweight and built on tools already provided.

推荐答案

Thoughtbot现在将Shoulda拆分为 Shoulda_contexts shoulda_matchers ,因此不必为Thoughtbot转向rspec担心.这意味着环境应该消失了.只是在社区中维护.

Thoughtbot have now split shoulda into shoulda_contexts and shoulda_matchers so the worry about a shift to rspec for thoughtbot doesn't mean shoulda contexts are going away. Just being maintained in the community.

这篇关于有人使用Minitest :: Spec进行Rails功能测试吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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