Sha256: 99efe1a517a8543fd10bb228efd0d2bdba52cd014919ccdffe59ee78185f8c93

Contents?: true

Size: 578 Bytes

Versions: 1

Compression:

Stored size: 578 Bytes

Contents

require_relative "../test_helper"
require "stig"
require "stig/generators/time"

include Stig

setup { Stig::Generators::Time }

test "defaults to dates between the UNIX epoch and \"now\"" do |mod|
  range = Time.at(0)..Time.now

  property(mod) do |time|
    assert_equal time.class, Time

    true
  end

  property(mod) do |time|
    assert range.cover?(time)

    true
  end
end

test "takes a Range" do |mod|
  range     = Time.at(200)..Time.at(300)
  generator = generator_for(mod, range)

  property(generator) do |time|
    assert range.cover?(time)

    true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stig-0.1.0 test/stig/time_generator.rb