Sha256: 4fdfc20c3918facd5d9ce34a0c57f7342068a411c8f5e9ab39c6ae43ccfd7212
Contents?: true
Size: 852 Bytes
Versions: 45
Compression:
Stored size: 852 Bytes
Contents
class ProgressBar class Time TIME_MOCKING_LIBRARY_METHODS = [ :__simple_stub__now, # ActiveSupport :now_without_mock_time, # Timecop :now_without_delorean, # Delorean :now # Actual ].freeze def initialize(time = ::Time) self.time = time end def now time.__send__ unmocked_time_method end def unmocked_time_method @unmocked_time_method ||= begin TIME_MOCKING_LIBRARY_METHODS.find do |method| time.respond_to? method end end end protected attr_accessor :time end end
Version data entries
45 entries across 45 versions & 6 rubygems