Class: RSpec::Support::ObjectFormatter::DateTimeInspector Private
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BaseInspector ,
Struct
|
|
Instance Chain:
self,
BaseInspector ,
Struct
|
|
Inherits: |
RSpec::Support::ObjectFormatter::BaseInspector
|
Defined in: | rspec-support/lib/rspec/support/object_formatter.rb |
Constant Summary
-
FORMAT =
# File 'rspec-support/lib/rspec/support/object_formatter.rb', line 160"%a, %d %b %Y %H:%M:%S.%N %z"
Class Method Summary
Instance Attribute Summary
BaseInspector
- Inherited
Instance Method Summary
-
#inspect
Internal use only
ActiveSupport sometimes overrides inspect.
BaseInspector
- Inherited
Class Method Details
.can_inspect?(object) ⇒ Boolean
# File 'rspec-support/lib/rspec/support/object_formatter.rb', line 162
def self.can_inspect?(object) defined?(DateTime) && DateTime === object end
Instance Method Details
#inspect
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 168
def inspect if defined?(ActiveSupport) object.strftime(FORMAT) else object.inspect end end