var tortuga = require('./../lib/tortuga.js');
var expect = require('chai').expect;

function search (search_terms) {
  tortuga.search(search_terms, function (results) { 
    for (var i = 0; i < results.length - 1; i++) {
      //results[i] is a Torrent object, this code verifies
      //results[0].PROPERTY > results[1].PROPERTY > ... > results[n].PROPERTY
      expect(results[i][search_terms.sortType.toLowerCase()])
            .to.be.at.least
            (results[i+1][search_terms.sortType.toLowerCase()])
    };
  });
}
search({query: process.argv[2], sortType: process.argv[3].toUpperCase() /*, category: process.argv[4].toUpperCase()*/ });
var tortuga = require('./../lib/tortuga.js');
var expect = require('chai').expect;

function search (search_terms) {
	tortuga.search(search_terms, function (results) {
		for (var i = 0; i < results.length - 1; i++) {
			expect(results[i][search_terms.sortType.toLowerCase()]).to.be.at.least(results[i+1][search_terms.sortType.toLowerCase()])
		};
	});
}
search({query: process.argv[2], sortType: process.argv[3].toUpperCase() /*, category: process.argv[4].toUpperCase()*/ });
Revert "fixed whitespacing, added comments to clarify test case"
Revert "fixed whitespacing, added comments to clarify test case"

This reverts commit 54d900f5aec6cd9e408624aa5cf1adbb413e7e4f.
