开发者

Unit Testing with Shoulda

edit: this problem only happens sometimes

This only appears to happen when I run the test from within TextMate (even when I specify the ruby to run it from by hand w开发者_如何学Pythonith a shebang). If I run it from the terminal then everything is peachy…


Here's some code:

require 'test/unit'
require 'shoulda'

class TestingTest < Test::Unit::TestCase
  context "My thing" do  
    should "always have this test fail, and give me this message" do
      assert false
    end
  end
end

I'm expecting it to tell me something like:

1) Failure:
test: My thing should always have this test fail, and give me this message (TestingTest)
# etc
An assert message, if one was given

But I'm getting:

1) Failure:
test:8
Failed assertion, no message given.

So what am I missing? The example code above is as simple as I think I can make it and I can't see the problem!


try inheriting from ActiveSupport::TestCase instead of the Test::Unit::TestCase

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜