]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(#11873) time function spec failure on Fixnum matcher
authorKen Barber <ken@bob.sh>
Tue, 10 Jan 2012 18:58:07 +0000 (18:58 +0000)
committerKen Barber <ken@bob.sh>
Tue, 10 Jan 2012 18:58:07 +0000 (18:58 +0000)
The rspec code for the time function was trying to match the type to be a
'Fixnum'. Ruby will sometimes make this a 'Bignum' depending on its internals
and we can't rely on this to be true all the time.

This patch just makes sure the type is an integer instead.

spec/unit/puppet/parser/functions/time_spec.rb

index 666e8e0fe6ced64d0574815219e3d828f21ffce2..5d6cd977f9514cda10c484c3683867006a905100 100644 (file)
@@ -20,7 +20,7 @@ describe "the time function" do
 
   it "should return a number" do
     result = @scope.function_time([])
-    result.class.should(eq(Fixnum))
+    result.should be_an(Integer)
   end
 
   it "should be higher then when I wrote this test" do