Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit caa6809

Browse files
committed
Test getSocketOptions() instead of getSocketPath()
1 parent 562786c commit caa6809

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

test/git-strategies.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ import * as reporterProxy from '../lib/reporter-proxy';
14341434

14351435
const [args, options] = execStub.getCall(1).args;
14361436
assertGitConfigSetting(args, op.command, 'gpg.program', '.*gpg-wrapper\\.sh$');
1437-
assert.isDefined(options.env.ATOM_GITHUB_SOCK_PATH);
1437+
assert.isDefined(options.env.ATOM_GITHUB_SOCK_ADDR);
14381438
assert.isDefined(options.env.ATOM_GITHUB_GPG_PROMPT);
14391439
});
14401440

@@ -1460,12 +1460,12 @@ import * as reporterProxy from '../lib/reporter-proxy';
14601460

14611461
const [args0, options0] = execStub.getCall(0).args;
14621462
assertGitConfigSetting(args0, op.command, 'gpg.program', '.*gpg-wrapper\\.sh$');
1463-
assert.isUndefined(options0.env.ATOM_GITHUB_SOCK_PATH);
1463+
assert.isUndefined(options0.env.ATOM_GITHUB_SOCK_ADDR);
14641464
assert.isUndefined(options0.env.ATOM_GITHUB_GPG_PROMPT);
14651465

14661466
const [args1, options1] = execStub.getCall(1).args;
14671467
assertGitConfigSetting(args1, op.command, 'gpg.program', '.*gpg-wrapper\\.sh$');
1468-
assert.isDefined(options1.env.ATOM_GITHUB_SOCK_PATH);
1468+
assert.isDefined(options1.env.ATOM_GITHUB_SOCK_ADDR);
14691469
assert.isDefined(options1.env.ATOM_GITHUB_GPG_PROMPT);
14701470
});
14711471
}

test/git-temp-dir.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,19 @@ describe('GitTempDir', function() {
4242
});
4343

4444
if (process.platform === 'win32') {
45-
it('generates a valid named pipe path for its socket', async function() {
45+
it('generates options to create a TCP socket on an unbound port', async function() {
4646
const tempDir = new GitTempDir();
4747
await tempDir.ensure();
4848

49-
assert.match(tempDir.getSocketPath(), /^\\\\\?\\pipe\\/);
49+
assert.deepEqual(tempDir.getSocketOptions(), {port: 0, host: 'localhost'});
5050
});
5151
} else {
5252
it('generates a socket path within the directory', async function() {
5353
const tempDir = new GitTempDir();
5454
await tempDir.ensure();
5555

56-
assert.isTrue(tempDir.getSocketPath().startsWith(tempDir.getRootPath()));
56+
const opts = tempDir.getSocketOptions();
57+
assert.isTrue(opts.path.startsWith(tempDir.getRootPath()));
5758
});
5859
}
5960

0 commit comments

Comments
 (0)