Skip to content

Instantly share code, notes, and snippets.

@laser
Created March 30, 2012 16:34
Show Gist options
  • Save laser/2252674 to your computer and use it in GitHub Desktop.
Save laser/2252674 to your computer and use it in GitHub Desktop.
Problem running tests with @testling - "curl: (52) Empty reply from server"
///////
// u.js
function isEmail (email) {
var regEx = /^[a-zA-Z0-9.!#$%&'*+-\/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
return regEx.test(email);
}
///////////
// test.js
var test = require('testling');
require.load("u.js");
test("isEmail", function(t) {
var fx = isEmail;
t.equal(true, fx("eswensonhealey@example.com"));
t.equal(true, fx("eswensonhealey@example"));
t.equal(false, fx("eswensonhealey@@example.com"));
t.equal(false, fx("@example.com"));
t.equal(false, fx("eswensonhealey@"));
t.equal(false, fx("eswensonhealey"));
t.equal(false, fx("@"));
t.equal(false, fx("@.com"));
t.equal(false, fx("a@.com"));
t.end();
});
//////////////////
// invoke Testling
machine:dir username$ tar -cf- u.js test.js | curl -u my.rad.email@example.com -vsSNT- testling.com?browsers=firefox/3.6
Enter host password for user 'my.rad.email@example.com':
* About to connect() to testling.com port 80 (#0)
* Trying 50.57.138.111... connected
* Connected to testling.com (50.57.138.111) port 80 (#0)
* Server auth using Basic with user 'my.rad.email@example.com'
> PUT /?browsers=firefox/3.6 HTTP/1.1
> Authorization: Basic ZXJpbi5zd2Vuc29uLmhlYWxleUBnbWFpbC5jb206eG9vZ2xpZTk=
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: testling.com
> Accept: */*
> Transfer-Encoding: chunked
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [data not shown]
* Empty reply from server
* Connection #0 to host testling.com left intact
curl: (52) Empty reply from server
* Closing connection #0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment