fluentnode
Version:
Fluent apis for node (based on the concepts used in C#'s FluentSharp
71 lines (68 loc) • 2.09 kB
JavaScript
// Generated by CoffeeScript 1.12.7
(function() {
require('../../src/fluentnode');
describe('| global', function() {
it('existy', function() {
existy(null).assert_False();
existy(void 0).assert_False();
existy({}.notHere).assert_False();
existy((function() {})()).assert_False();
existy(this).assert_True();
existy(0).assert_True();
existy(true).assert_True();
return existy(false).assert_True();
});
it('file_Exists', function() {
var temp_File;
temp_File = '_temp_file_'.add_5_Letters().file_Create('abc');
file_Exists(temp_File).assert_True();
file_Exists('.abc').assert_False();
file_Exists(null).assert_False();
file_Exists(void 0).assert_False();
file_Exists({}.notHere).assert_False();
return temp_File.assert_File_Deleted();
});
it('is_Number', function() {
is_Number(0).assert_True();
is_Number(-1).assert_True();
is_Number(9999).assert_True();
is_Number(0/0).assert_False();
is_Number('').assert_False();
is_Number('ab').assert_False();
return is_Number(null).assert_False();
});
it('is_Null', function() {
is_Null(null).assert_True();
is_Null(void 0).assert_False();
is_Null('').assert_False();
return is_Null(0).assert_False();
});
it('not_Null', function() {
return not_Null.assert_Is(existy);
});
it('using', function() {
var target;
target = {
a: 'abc',
b: 42
};
using.assert_Is_Function();
is_Null(this.a);
is_Null(this.b);
return using(target, function() {
this.a.assert_Is('abc');
return this.b.assert_Is(42);
});
});
return it('truthly', function() {
truthly(null).assert_False();
truthly(false).assert_False();
truthly(void 0).assert_False();
truthly(0).assert_True();
truthly(1).assert_True();
truthly('').assert_True();
truthly(' ').assert_True();
return truthly(true).assert_True();
});
});
}).call(this);