gpt4 book ai didi

ruby-on-rails - 使用 rspec 和 rails 测试嵌套模块

转载 作者:数据小太阳 更新时间:2023-10-29 07:12:12 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Testing modules in rspec

目前我正在使用 rspec 成功测试我的模块,如下所示:

require 'spec_helper'

module Services
module AppService
describe AppService do
describe "authenticate" do
it "should authenticate the user" do
pending "authenticate the user"
end
end
end
end
end

我的模块位于应用程序/服务/services.rb应用程序/服务/app_service.rb

然而,是否有更优雅的解决方案来测试我的模块而无需在规范中声明 namespace ?我觉得它与我的规范紧密相关,进行更改会引起很多麻烦。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com