This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
scratch-html5/test/unit/threadSpec.js
2014-04-09 01:18:14 -07:00

50 lines
1.5 KiB
JavaScript

/* jasmine specs for Interpreter.js -> Thread go here */
describe('Thread', function() {
var thread;
beforeEach(function() {
thread = Thread;
});
describe('Initialized variables', function() {
var initThread;
beforeEach(function() {
initThread = new thread('block', 'target');
});
describe('Thread Variables', function() {
it('should have a nextBlock variable', function() {
expect(initThread.nextBlock).toBe('block');
});
it('should have a firstBlock variable', function() {
expect(initThread.firstBlock).toBe('block');
});
it('should have a stack variable', function() {
expect(initThread.stack).toEqual([]);
});
it('should have a target variable', function() {
expect(initThread.target).toBe('target');
});
it('should have a tmp variable', function() {
expect(initThread.tmp).toBe(null);
});
it('should have a tmpObj variable', function() {
expect(initThread.tmpObj).toEqual([]);
});
it('should have a firstTime variable', function() {
expect(initThread.firstTime).toBe(true);
});
it('should have a paused variable', function() {
expect(initThread.paused).toBe(false);
});
});
});
});