Sha256: 16e99f2dc577a08c3097a88708ec6aaa2e67d310b76a1ed93e0ac44a9731a304

Contents?: true

Size: 359 Bytes

Versions: 7

Compression:

Stored size: 359 Bytes

Contents

require 'minitest/mock'

module Assertions
  def assert_not(object, message = nil)
    message ||= "Expected #{object} to be nil or false"
    assert !object, message
  end

  def freeze_time(&block)
    if block
      reference_date = Time.now

      Time.stub :now, reference_date do
        block.call
      end
    else
      block.call
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
activestorage_legacy-0.2.1 test/support/assertions.rb
activestorage_legacy-0.2.0 test/support/assertions.rb
activestorage_legacy-0.1.3 test/support/assertions.rb
activestorage_legacy-0.1.2 test/support/assertions.rb
activestorage_legacy-0.1.1 test/support/assertions.rb
activestorage_legacy-0.1.1.alpha test/support/assertions.rb
activestorage_legacy-0.1 test/support/assertions.rb