RSPEC 正在查找我的文件,但找不到我的示例

RSPEC is finding my file but not my examples

所以我在我的文件中放了一个 "hello world" 以确保我正在访问该文件,果然,它被打印出来了。但是,我的示例中有 none 个是 运行。它说 "no examples found"。有什么想法吗?

require 'rails_helper'

class PostsControllerTest < ActionController::TestCase

  print "hello world"

  setup do
    @post = posts(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:posts)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create post" do
    assert_difference('Post.count') do
      post :create, post: { body: @post.body, title: @post.title }
    end

    assert_redirected_to post_path(assigns(:post))
  end

  test "should show post" do
    get :show, id: @post
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @post
    assert_response :success
  end

  test "should update post" do
    patch :update, id: @post, post: { body: @post.body, title: @post.title }
    assert_redirected_to post_path(assigns(:post))
  end

  test "should destroy post" do
    assert_difference('Post.count', -1) do
      delete :destroy, id: @post
    end

    assert_redirected_to posts_path
  end
end

如果更多代码有帮助,请告诉我。谢谢

那不是 rspec,那是 testunit,你不 运行 它与 rspec,你 运行 它与 rake test