当我尝试使用此命令执行功能测试时
ruby -I. supplier_controller_test.rb
现在代码:
require File.dirname(__FILE__) + '/../../test_helper'
require 'admin/supplier_controller'
# Re-raise errors caught by the controller.
class Admin::SupplierController; def rescue_action(e) raise e end; end
class Admin::SupplierControllerTest < ActionController::TestCase
fixtures :suppliers
def setup
@controller = Admin::SupplierController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
def test_new
get :new
assert_template 'admin/supplier/new'
assert_tag 'h1', :content => 'Create new supplier'
assert_tag 'form', :attributes => {:action => '/admin/supplier/create'}
end
end
这是我得到的错误
No such file or directory - ./log/acts_as_ferret.log (Errno::ENOENT)
假设应该存在acts_as_ferret.log?
答案 0 :(得分:0)
当您使用-I选项运行ruby -I . path_to_code
时,您将提供从中加载库的目录。
从错误中看起来您正在尝试从刚刚指定的目录加载log / acts_as_ferret.log。
您是否可能想要使用其他目录?