Spork:如何刷新验证和其他代码? [英] Spork: how to refresh validations and other code?

查看:145
本文介绍了Spork:如何刷新验证和其他代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我整天都在使用spork,在大多数情况下,这真的很棒.

I've been using spork all day, and most of the time it is a really great.

但是,我经常遇到一些问题,需要重新启动Spork才能通过测试...现在,我想知道这是否比所需要的更多麻烦.我是ruby的新手,所以有时我无法预测错误是由于刷新问题引起的,还是由于我对Ruby和Rails的不熟悉引起的.

However, I am often running into a few problems where I need to restart Spork in order for my tests to pass... and now I'm wondering if it's more trouble than it's worth. I am new at ruby, so sometimes I can't predict if the error is due to a refresh problem, or if the error is due to my unfamiliarity with Ruby and Rails.

我需要放入Spork.each_run块中什么,以便刷新验证和其他内容,而不必重新启动Spork服务器?

What do I need to put into Spork.each_run block so that my validations and other things are refreshed so that I don't have to restart the spork server?

谢谢

推荐答案

在更新类时,请使用Guard重新加载Spork. Guard :: Spork允许自动&智能地启动/重新加载RSpec/Cucumber Spork服务器.

Use Guard to reload Spork when you update your classes Guard::Spork allows to automatically & intelligently start/reload your RSpec/Cucumber Spork server(s).

  1. https://github.com/guard/guard-spork
  2. http://flux88.com/2011/04/using-guard- spork-with-mongoid-devise/
  1. https://github.com/guard/guard-spork
  2. http://flux88.com/2011/04/using-guard-spork-with-mongoid-devise/

这篇关于Spork:如何刷新验证和其他代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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