---
title: "autotest+cucumber无限循环测试的BUG解决"
author: "ZoOL"
date: "2010-08-12T05:52:06Z"
tags: []
categories: ["编程语言"]
slug: "autotest-cucumber-bug"
draft: false
lastmod: "2010-08-15T16:13:02Z"
id: 735078
url: "https://zool.iteye.com/blog/735078"
---

在使用AUTOFEATURE=true autotest测试项目时， cucumber测试无限循环报错。 原因在于cucumber测试时生成了rerun.txt，所以解决方法就是编辑~/.autotest，加上下面的代码

```
Autotest.add_hook :initialize do |at|
    at.add_exception(%r{^\./\.git})
    at.add_exception(%r{^\./db})
    at.add_exception(%r{^\./log})
    at.add_exception(%r{^\./tmp})
    at.add_exception(%r{^\./rerun.txt})
    at.add_exception(%r{^\./Gemfile.lock})
  end
```