【发布时间】:2010-10-16 18:03:25
【问题描述】:
我正在尝试测试一个轨道、应用程序,在一种特殊情况下,我需要在我的测试用例中创建一个 TimeWithZone 对象。所以我这样写:
started_at = ActiveSupport::TimeWithZone(started_at, Time.zone)
只是为了得到一个错误:
NoMethodError: undefined method `TimeWithZone' for ActiveSupport:Module
我尝试要求 'active_support'、'active_support/time'、''active_support/time_with_zone'。当我运行测试时,这些语句中的每一个都评估为 false(在 irb 中运行良好)
知道我做错了什么吗?
【问题讨论】:
标签: ruby-on-rails ruby activesupport