module TestBench::Controls::Time

Public Class Methods

day() click to toggle source
# File lib/test_bench/controls/time.rb, line 38
def self.day
  1
end
example(seconds_offset: nil) click to toggle source
# File lib/test_bench/controls/time.rb, line 4
def self.example(seconds_offset: nil)
  seconds_offset ||= 0

  year = self.year
  month = self.month
  day = self.day

  hours = self.hours
  minutes = self.minutes
  seconds = self.seconds + seconds_offset

  if not RUBY_ENGINE == 'mruby'
    tz_offset = self.tz_offset

    final_argument = tz_offset
  else
    seconds, subseconds = seconds.divmod(1)

    microseconds = subseconds * 1_000_000

    final_argument = microseconds
  end

  ::Time.new(year, month, day, hours, minutes, seconds, final_argument)
end
hours() click to toggle source
# File lib/test_bench/controls/time.rb, line 42
def self.hours
  11
end
minutes() click to toggle source
# File lib/test_bench/controls/time.rb, line 46
def self.minutes
  11
end
month() click to toggle source
# File lib/test_bench/controls/time.rb, line 34
def self.month
  1
end
seconds() click to toggle source
# File lib/test_bench/controls/time.rb, line 50
def self.seconds
  11.0
end
tz_offset() click to toggle source
# File lib/test_bench/controls/time.rb, line 54
def self.tz_offset
  0
end
year() click to toggle source
# File lib/test_bench/controls/time.rb, line 30
def self.year
  2000
end