如何在IRB会话中包含RSpec助手?

时间:2016-09-04 12:06:45

标签: rspec pry

说我做了一个方便的花花公子助手:

RSpec.configure do |config|
    config.include HandyDandyHelper
end

如何将其包含在IRB会话中?

[16] pry(main)> include HandyDandyHelper
NameError: uninitialized constant HandyDandyHelper

1 个答案:

答案 0 :(得分:1)

在包含模块之前,您必须要求包含该模块的文件,因此Ruby知道您正在谈论的代码。

SELECT CampName, 
    COUNT(ListName)-COUNT(DISTINCT CONCAT(id,ListName)) tot 
FROM #tmp 
GROUP BY CampName 

辅助文件的路径是相对于启动IRB的目录。