Same question as waloeiii in twitter:
与twitter中的waloeiii相同的问题:
How can I have autospec/test not run the full test suite after everything goes green? The next test I write will be red!
在一切都变绿之后,如何让autospec / test不运行完整的测试套件?我写的下一个测试将是红色的!
I'd rather run the full test suite manually.
我宁愿手动运行完整的测试套件。
By the way, I tried adding a failing spec:
顺便说一下,我尝试添加一个失败的规范:
it "should flunk" do
flunk
end
but autospec seems to ignore it when it feels like it.
但是当感觉它时,autospec似乎忽略了它。
4 个解决方案
#1
Bit late but I was looking for this as well so thought I'd post my solution:
有点迟,但我也在寻找这个,所以我想发布我的解决方案:
Add the following to ~/.autotest:
将以下内容添加到〜/ .autotest:
class Autotest
def rerun_all_tests
end
end
#2
Are you sure you are not confused about the intended behaviour of autotest's heuristics?
您确定不会对自动测试启发式的预期行为感到困惑吗?
My understanding is that it runs tests for what has changed and will keep running failed tests until they pass and then once they pass it runs the whole test suite to make sure nothing else broke.
我的理解是它运行测试已更改的内容,并将继续运行失败的测试,直到它们通过,然后一旦它通过它运行整个测试套件,以确保没有其他任何破坏。
In effect it is being conservative and making sure you haven't introduced side effects that break other unrelated tests which is probably a good thing. The problem of course is that if you are doing fast red - green cycles you are going to be running your full suite a lot.
实际上它是保守的,并确保你没有引入打破其他无关测试的副作用,这可能是一件好事。问题当然是,如果你正在进行快速的红绿色循环,你将会运行你的全套房间。
If you want to change these behaviours you need to edit the heuristics in the rails_autotest.rb
file for zentest.
如果要更改这些行为,则需要在rails_autotest.rb文件中编辑针对zentest的启发式方法。
#3
You can use the following option to avoid this behavior -
您可以使用以下选项来避免此行为 -
autospec --no-full-after-failed
#4
I think that this is by design - if you fix a failing spec, and all other specs in the section are green, then autospec will rerun the entire suite - this will tell you if the fix you applied to one area of your project has b0rked another or not.
我认为这是设计的 - 如果您修复了失败的规范,并且该部分中的所有其他规格都是绿色的,那么autospec将重新运行整个套件 - 这将告诉您应用于项目的某个区域的修复是否具有b0rked另一个与否。
If you just want to run the specs you are working on at any one time, then you can do it from the command line:
如果您只想在任何时候运行您正在处理的规范,那么您可以从命令行执行此操作:
ruby spec/controllers/my_spec.rb
or from within Textmate by pressing cmd+r from your spec file. You should rerun your entire suite as you go anyway, otherwise you might be missing failing specs.
或者从您的spec文件中按cmd + r从Textmate中。无论如何,您应该重新运行整个套件,否则您可能会丢失失败的规格。
#1
Bit late but I was looking for this as well so thought I'd post my solution:
有点迟,但我也在寻找这个,所以我想发布我的解决方案:
Add the following to ~/.autotest:
将以下内容添加到〜/ .autotest:
class Autotest
def rerun_all_tests
end
end
#2
Are you sure you are not confused about the intended behaviour of autotest's heuristics?
您确定不会对自动测试启发式的预期行为感到困惑吗?
My understanding is that it runs tests for what has changed and will keep running failed tests until they pass and then once they pass it runs the whole test suite to make sure nothing else broke.
我的理解是它运行测试已更改的内容,并将继续运行失败的测试,直到它们通过,然后一旦它通过它运行整个测试套件,以确保没有其他任何破坏。
In effect it is being conservative and making sure you haven't introduced side effects that break other unrelated tests which is probably a good thing. The problem of course is that if you are doing fast red - green cycles you are going to be running your full suite a lot.
实际上它是保守的,并确保你没有引入打破其他无关测试的副作用,这可能是一件好事。问题当然是,如果你正在进行快速的红绿色循环,你将会运行你的全套房间。
If you want to change these behaviours you need to edit the heuristics in the rails_autotest.rb
file for zentest.
如果要更改这些行为,则需要在rails_autotest.rb文件中编辑针对zentest的启发式方法。
#3
You can use the following option to avoid this behavior -
您可以使用以下选项来避免此行为 -
autospec --no-full-after-failed
#4
I think that this is by design - if you fix a failing spec, and all other specs in the section are green, then autospec will rerun the entire suite - this will tell you if the fix you applied to one area of your project has b0rked another or not.
我认为这是设计的 - 如果您修复了失败的规范,并且该部分中的所有其他规格都是绿色的,那么autospec将重新运行整个套件 - 这将告诉您应用于项目的某个区域的修复是否具有b0rked另一个与否。
If you just want to run the specs you are working on at any one time, then you can do it from the command line:
如果您只想在任何时候运行您正在处理的规范,那么您可以从命令行执行此操作:
ruby spec/controllers/my_spec.rb
or from within Textmate by pressing cmd+r from your spec file. You should rerun your entire suite as you go anyway, otherwise you might be missing failing specs.
或者从您的spec文件中按cmd + r从Textmate中。无论如何,您应该重新运行整个套件,否则您可能会丢失失败的规格。