【发布时间】:2012-10-10 18:34:28
【问题描述】:
目前我正在使用 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
我的模块位于 应用程序/服务/服务.rb app/services/app_service.rb
但是,有没有更优雅的解决方案来测试我的模块而无需在规范中声明命名空间?我觉得它与我的规范紧密相关,进行更改会引起很多麻烦。
【问题讨论】:
-
这不是问题 1542945 的重复,这个问题一般涉及嵌套模块而不是测试模块。
-
@Deefour - 正如 David Basarab 所说,这不是 1542945 的副本。这是一个很好的问题,我找不到真正的副本。
标签: ruby-on-rails ruby testing rspec