我似乎无法使 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 中的代码。挂起的方法在一个 unless defined?(Spec) 块内,但我验证了 Spec 没有定义。
提前致谢...