aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/hostname_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-07 19:46:33 +0200
committerGitHub <noreply@github.com>2017-04-07 19:46:33 +0200
commit13352c00f1909d9296c5f276a3735f5e6f231b39 (patch)
treec0dc65954b3084b6d98185f7b84ce62f8b32d185 /test/functional/eval/hostname_spec.lua
parent1813076c448f1039db33e08e83b7f1f2011db0ee (diff)
downloadrneovim-13352c00f1909d9296c5f276a3735f5e6f231b39.tar.gz
rneovim-13352c00f1909d9296c5f276a3735f5e6f231b39.tar.bz2
rneovim-13352c00f1909d9296c5f276a3735f5e6f231b39.zip
win: os_get_hostname() #5416 (#6413)
Diffstat (limited to 'test/functional/eval/hostname_spec.lua')
-rw-r--r--test/functional/eval/hostname_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/eval/hostname_spec.lua b/test/functional/eval/hostname_spec.lua
new file mode 100644
index 0000000000..f1867846c4
--- /dev/null
+++ b/test/functional/eval/hostname_spec.lua
@@ -0,0 +1,17 @@
+local helpers = require('test.functional.helpers')(after_each)
+local ok = helpers.ok
+local call = helpers.call
+local clear = helpers.clear
+
+describe('hostname()', function()
+ before_each(clear)
+
+ it('returns hostname string', function()
+ local actual = call('hostname')
+ ok(string.len(actual) > 1)
+ if call('executable', 'hostname') == 1 then
+ local expected = string.gsub(call('system', 'hostname'), '[\n\r]', '')
+ helpers.eq(expected, actual)
+ end
+ end)
+end)