Skip to content
Myr

Added specs for sort()

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

authored by visionmedia · committed by visionmedia · parent 460c2a0 · Browse files · 1 file+14 added−0 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+14 added−0 removed

  • tests:+14 added−0 removed

1 file+14 added−0 removed

modified:spec/spec.collection.js+14 added
184 unmodified lines
185 $({ foo: 'bar', baz: 'raz' }).keys().at(1).should.eql 'baz'186 end187 end188 189 describe '#sort()'190 it 'should sort using a function'191 var result = $([4,2,3,1]).sort(function(n, other){192 return n < other ? -1 :193 n > other ? 1 :194 0195 })196 result.at(0).should.eql 1197 result.at(1).should.eql 2198 result.at(2).should.eql 3199 result.at(3).should.eql 4200 end201 end202 203 describe '#toArray()'204 it 'should return an array'205 $(['foo', 'bar']).keys().toArray().should.eql [0, 1]206 end
16 unmodified lines