Sha256: 07a5bdb62f299945562dc02aa8293fe63e36df034bd52d3bd575c8067a161f44

Contents?: true

Size: 323 Bytes

Versions: 20

Compression:

Stored size: 323 Bytes

Contents

###
# In our specs, I want to make sure time gets mocked so I can accurately test
# times displayed to the user.
#
class PBTimeTester
  def self.now
    ::Time.now
  end
end

class ::ProgressBar::Time
  class << self
    alias_method :old_now, :now

    def now(time = ::PBTimeTester)
      old_now(time)
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/support/time.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/support/time.rb
ruby-progressbar-1.6.1 spec/support/time.rb
ruby-progressbar-1.6.0 spec/support/time.rb
ruby-progressbar-1.5.1 spec/support/time.rb
ruby-progressbar-1.5.0 spec/support/time.rb
ruby-progressbar-1.4.2 spec/support/time.rb
ruby-progressbar-1.4.1 spec/support/time.rb
ruby-progressbar-1.4.0 spec/support/time.rb
ruby-progressbar-1.3.2 spec/support/time.rb
ruby-progressbar-1.3.1 spec/support/time.rb
ruby-progressbar-1.3.0 spec/support/time.rb
ruby-progressbar-1.2.0 spec/support/time.rb
ruby-progressbar-1.1.1 spec/support/time.rb
ruby-progressbar-1.1.0 spec/support/time.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/ruby-progressbar-1.0.2/spec/support/timecop.rb
ruby-progressbar-1.0.2 spec/support/timecop.rb
ruby-progressbar-1.0.1 spec/support/timecop.rb
ruby-progressbar-1.0.0 spec/support/timecop.rb
ruby-progressbar-1.0.0rc1 spec/support/timecop.rb