Sha256: d8642895e1cfa2192612e4ee6ccfa0e6db68a036354f86dd06e8c1d6f13e0ef8
Contents?: true
Size: 960 Bytes
Versions: 278
Compression:
Stored size: 960 Bytes
Contents
#! /usr/bin/env ruby require 'spec_helper' require 'puppet/indirector/envelope' describe Puppet::Indirector::Envelope do before do @instance = Object.new @instance.extend(Puppet::Indirector::Envelope) end describe "when testing if it is expired" do it "should return false if there is no expiration set" do expect(@instance).not_to be_expired end it "should return true if the current date is after the expiration date" do @instance.expiration = Time.now - 10 expect(@instance).to be_expired end it "should return false if the current date is prior to the expiration date" do @instance.expiration = Time.now + 10 expect(@instance).not_to be_expired end it "should return false if the current date is equal to the expiration date" do now = Time.now Time.stubs(:now).returns(now) @instance.expiration = now expect(@instance).not_to be_expired end end end
Version data entries
278 entries across 278 versions & 1 rubygems