class RSpec::Support::ObjectFormatter::DateTimeInspector

Constants

FORMAT

Public Class Methods

# File rspec-support/lib/rspec/support/object_formatter.rb, line 164
def self.can_inspect?(object)
  defined?(DateTime) && DateTime === object
end

Public Instance Methods

ActiveSupport sometimes overrides inspect. If ‘ActiveSupport` is defined use a custom format string that includes more time precision.

# File rspec-support/lib/rspec/support/object_formatter.rb, line 170
def inspect
  if defined?(ActiveSupport)
    object.strftime(FORMAT)
  else
    object.inspect
  end
end