开发者

How to use the Pending module in ActiveSupport

I can't seem to make the Pending module in ActiveSupport::Testing work.

test/unit/pending.rb contains:

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

But when I execute ruby unit/foo.rb, I get:

undefine开发者_如何学God method `pending' for PendingTest:Class (NoMethodError)

I looked in the code in pending.rb in the ActiveSupport gem. The pending method is inside an unless defined?(Spec) block, but I verified that Spec is not defined.

Thanks in advance...


the pending method needs to be called inside a test, rather than on the class:

test "it works" do
  pending "well, it will eventually"
end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜