在您的測試中使用 FixtureResolver
模擬資料夾中的檔案存在。這會在 Rails 自訂測試套件內部使用,可用於測試 extensions,而 extension 並不知道在執行階段檔案系統會呈現什麼。
方法
類別公開方法
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