Sha256: 85fac2334fc77a8c43d5357cae21eb4abebefd060a80f98060f39317f9ff6187

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

require([
		'classes/builtin-commands', 
		'specs/doubles/uiobject-double', 
		'specs/doubles/mock-jamservice'
		], function(){
		
		module("describe cd command spec")
		
		test("it should write not found to the console if resource", function() {
		  	
			// arrange
			var items = [{href:'http://something.com'}, {href:'http://something.com'}];
			var service = new MockJamService(items);
			var cdCommand = new CdCommand(service);

		  	// act
			cdCommand.execute(["articles"], function(){});
			
			equal(Session.currentFolder, "articles");
			
		});
		
		test("it should write folder not found if result undefined", function() {
		  	// arrange
			var service = new MockJamService(undefined);
			var cdCommand = new CdCommand(service);

		  	// act
			cdCommand.execute(["doesnotexist"], function(output){
				
				equal(output, "folder not found!");
				
			});
			
		});
		
		test("it should write folder not found if result null", function() {
		  	// arrange
			var service = new MockJamService(null);
			var cdCommand = new CdCommand(service);

		  	// act
			cdCommand.execute(["doesnotexist"], function(output){
				
				equal(output, "folder not found!");
				
			});
			
		});
				
	});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
koda-0.0.12 public/koda/scripts/specs/cd-command-spec.js
koda-0.0.11 public/koda/scripts/specs/cd-command-spec.js
koda-0.0.9 public/koda/scripts/specs/cd-command-spec.js
koda-0.0.8 public/koda/scripts/specs/cd-command-spec.js