【发布时间】:2012-10-03 23:16:16
【问题描述】:
我显然做错了什么。我正在尝试在单个文件中编写和测试纯红宝石。我想让守卫观察文件和测试文件,并在任何文件更改时运行 minitest。
所以,两个文件:game.rb 和 game_test.rb
游戏.rb
class Game
end
game_test.rb
require 'rubygems'
require 'minitest/autorun'
require './game'
class GameTest < MiniTest::Unit::TestCase
def test_truth
assert true
end
end
我还有一个看起来像这样的 Guardfile:
notification :terminal_notifier
guard 'minitest', test_folders: '.' do
watch('game.rb')
watch('game_test.rb')
end
现在,我可能忘记了一些东西,但我终生无法弄清楚它是什么。
如果我开始守卫并按 Enter,则会发生“全部运行”并且测试会运行.. 至少在大多数情况下。但是,我必须按 Enter 才能发生。
此外,如果我对文件进行更改,则不会发生任何事情。我尝试将 gem 'rb-fsevent' 放入 Gemfile 并使用“bundle exec guard”运行,但这似乎也无济于事。
任何帮助将不胜感激。我要疯了。
谢谢, 杰里米
【问题讨论】:
标签: ruby testing guard minitest