Skip to content
Myr

Stubbing Math.random() for Collection#sample() spec

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 14c9568 · Browse files · 1 file+2 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−3 removed

  • tests:+2 added−3 removed

1 file+2 added−3 removed

modified:spec/spec.collection.js+2 added-3 removed
341 unmodified lines
342 end343 344 describe '#sample()'345 it 'should return a random value'346 var a = $([1,2,3,4]).sample()347 var b = $([1,2,3,4]).sample()348 a.should.not.eql b346 Math.stub('random').and_return(0.1)347 $([1,2,3,4]).sample().should.eql 1348 end349 end350 351 describe '#toString()'
15 unmodified lines