在轨道上运行ruby测试

时间:2010-10-10 08:15:43

标签: ruby-on-rails

我使用RubyMine,Windows

我写了测试:

class PostTest < ActiveSupport::TestCase
    # Replace this with your real tests.
    fixtures :posts
    test "the truth" do
        @first_posts = posts(:first_posts)
        assert @first_posts.title == "Ruby on rails"
    end
end

但是当我使用rubyMine运行测试时(使用底部按钮我选择“test”并运行它) 我明白这个

C:\Ruby187\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby187\bin/rake test
Testing started at 1:44 PM ...
(in D:/Projects/TestProject)
Empty test suite.
0 tests, 0 assertions, 0 failures, 0 errors
Test suite finished: 0.031002 seconds
Errors running test:units!
Empty test suite.

Process finished with exit code 1

例如,我的测试套件是空的,但测试套件有一个测试:“真相”

当我从控制台(ruby post_test.rb)运行测试时,我有

D:\Projects\TestProject\test>ruby unit/post_test.rb
Loaded suite unit/post_test
Started
Ruby on rails
.
Finished in 1.7471 seconds.

1 tests, 1 assertions, 0 failures, 0 errorsWhat's wrong?

1 个答案:

答案 0 :(得分:0)

此漏洞RubyMine(build 98.47)http://youtrack.jetbrains.net/issue/RUBY-6158