File: time.rb

package info (click to toggle)
ruby-progressbar 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 840 kB
  • sloc: ruby: 2,958; sh: 29; makefile: 10
file content (17 lines) | stat: -rw-r--r-- 279 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
###
# 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
class Time
  def initialize(time = ::PBTimeTester)
    self.time = time
  end
end
end