Rails、アプリケーションをテストしようとしていますが、ある特定のケースでは、テストケース内に TimeWithZone オブジェクトを作成する必要があります。だから私はこのようにsthを書きます:
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 では正常に動作します)。
私が間違っていることについて何か考えはありますか?