在测试中使用 FixtureResolver 来模拟文件系统中的文件存在。Rails 自己的测试套件内部使用了它,并且对于测试那些无法得知运行时文件系统样子的扩展非常有用。
方法
类公共方法
new(hash = {}) 链接
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/testing/resolvers.rb, line 11 def initialize(hash = {}) super("") @hash = hash @path = "" end
实例公共方法
data() 链接
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/testing/resolvers.rb, line 17 def data @hash end
to_s() 链接
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/testing/resolvers.rb, line 21 def to_s @hash.keys.join(", ") end