aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/hostname_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
committerZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
commit043d8ff9f2389f8deab7934aa0ab4ce88a747f01 (patch)
tree4d6fa32d7c1ddaa99c15f80c1a4ba95d5f3ca2da /test/functional/eval/hostname_spec.lua
parent5992cdf3c27ee9c73cea22e288c6ea6d54867394 (diff)
parent13352c00f1909d9296c5f276a3735f5e6f231b39 (diff)
downloadrneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.gz
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.bz2
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.zip
Merge branch 'master' into luaviml'/lua
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)