mmi*_*dol 2 testing activesupport ruby-on-rails-3
我似乎无法使ActiveSupport :: Testing中的Pending模块工作.
test/unit/pending.rb包含:
require 'test_helper'
require 'active_support/testing/pending'
class PendingTest < ActiveSupport::TestCase
include ActiveSupport::Testing::Pending
pending "a pending case with a closure" do
assert false
end
end
Run Code Online (Sandbox Code Playgroud)
但是当我执行ruby unit/foo.rb时,我得到:
undefined method `pending' for PendingTest:Class (NoMethodError)
Run Code Online (Sandbox Code Playgroud)
我查看了ActiveSupport gem中pending.rb中的代码.挂起的方法在除非定义的?(Spec)块之内,但我确认未定义Spec.
提前致谢...
该pending方法需要在测试中调用,而不是在类上调用:
test "it works" do
pending "well, it will eventually"
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2344 次 |
| 最近记录: |