跳至内容 跳至搜索

在测试中使用 FixtureResolver 来模拟文件系统中的文件存在。Rails 自己的测试套件内部使用了它,并且对于测试那些无法得知运行时文件系统样子的扩展非常有用。

方法
D
N
T

类公共方法

new(hash = {})

# File actionview/lib/action_view/testing/resolvers.rb, line 11
def initialize(hash = {})
  super("")
  @hash = hash
  @path = ""
end

实例公共方法

data()

# File actionview/lib/action_view/testing/resolvers.rb, line 17
def data
  @hash
end

to_s()

# File actionview/lib/action_view/testing/resolvers.rb, line 21
def to_s
  @hash.keys.join(", ")
end