我似乎无法使 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
但是当我执行 ruby unit/foo.rb 时,我得到:
undefined method `pending' for PendingTest:Class (NoMethodError)
我查看了 ActiveSupport gem 中 pending.rb 中的代码。挂起的方法在一个 除非定义?(规范) block ,但我确认未定义 Spec。
提前致谢...
最佳答案
pending
方法需要在测试中调用,而不是在类中调用:
test "it works" do
pending "well, it will eventually"
end
关于ruby-on-rails-3 - 如何使用 ActiveSupport 中的 Pending 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5467481/