spec/naturally_spec.rb in naturally-1.0.4 vs spec/naturally_spec.rb in naturally-1.0.5
- old
+ new
@@ -23,9 +23,15 @@
it 'sorts when numbers have letters in them' do
a = %w[335 335.1 336a 336 337 337a 337.1 337.15 337.2]
b = %w[335 335.1 336 336a 337 337.1 337.2 337.15 337a]
Naturally.sort(a).should == b
end
+
+ it 'sorts when letters have numbers in them' do
+ a = %w[PC1, PC3, PC5, PC7, PC9, PC10, PC11, PC12, PC13, PC14, PROF2, PBLI, SBP1, SBP3]
+ b = %w[PBLI, PC1, PC3, PC5, PC7, PC9, PC10, PC11, PC12, PC13, PC14, PROF2, SBP1, SBP3]
+ Naturally.sort(a).should == b
+ end
it 'sorts double digits with letters correctly' do
a = %w[12a 12b 12c 13a 13b 2 3 4 5 10 11 12]
b = %w[2 3 4 5 10 11 12 12a 12b 12c 13a 13b]
Naturally.sort(a).should == b
\ No newline at end of file