var chai = require('chai');
var expect = require('chai').expect;
var fs = require('fs');
var path = require('path');
var rimraf = require('rimraf');

var {Helper, Type} = require('@kaoscript/runtime');

require('../register');

describe('evaluate', function() {
	before(function(done) {
		rimraf(path.join(__dirname, 'fixtures', 'evaluate', '*.{ksb,ksh,ksm}'), done);
	});
	
	var files = fs.readdirSync(path.join(__dirname, 'fixtures', 'evaluate'));
	
	var file;
	for(var i = 0; i < files.length; i++) {
		file = files[i];
		
		if(file.slice(-3) === '.ks') {
			prepare(file);
		}
	}
	
	function prepare(file) {
		var name = file.slice(0, -3);
		it(name, function() {
			this.timeout(5000);
			
			require(path.join(__dirname, 'fixtures', 'evaluate', file))(expect, Helper, Type);
		});
	}
	
	after(function(done) {
		rimraf(path.join(__dirname, 'fixtures', 'evaluate', '*.{ksb,ksh,ksm}'), done);
	});
});
@@ -146,27 +146,14 @@
 ');%0A
-%0A
 var 
-%7BHelper, Type%7D
+rt
  = r
@@ -750,16 +750,19 @@
 ct, 
+rt.
 Helper, 
 Type
@@ -757,16 +757,19 @@
 Helper, 
+rt.
 Type);%0A%09

fix tests