summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-07 22:15:33 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-07 22:15:33 -0600
commit7b1ef4aa3f0fbe0b0742a272327ba29325bd917c (patch)
tree67198cad1ec397a4c8ed35cc0535eb6e07d84a1e /tests
parentd1b9110c038ed1e8d1e1fe2c959377f0a43706a2 (diff)
downloadhorizon-7b1ef4aa3f0fbe0b0742a272327ba29325bd917c.tar.gz
horizon-7b1ef4aa3f0fbe0b0742a272327ba29325bd917c.tar.bz2
horizon-7b1ef4aa3f0fbe0b0742a272327ba29325bd917c.tar.xz
horizon-7b1ef4aa3f0fbe0b0742a272327ba29325bd917c.zip
owner: New utility
Diffstat (limited to 'tests')
-rw-r--r--tests/spec/owner_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/spec/owner_spec.rb b/tests/spec/owner_spec.rb
new file mode 100644
index 0000000..32719ec
--- /dev/null
+++ b/tests/spec/owner_spec.rb
@@ -0,0 +1,26 @@
+require 'spec_helper'
+
+RSpec.describe 'HorizonScript Owner Print Utility', :type => :aruba do
+ context "argument passing" do
+ it "requires an path to be specified" do
+ run_command 'hscript-printowner'
+ expect(last_command_started).to have_output(/requires a path or file/)
+ end
+ it "requires exactly one path to be specified" do
+ run_command 'hscript-printowner a b c'
+ expect(last_command_started).to have_output(/requires a path or file/)
+ end
+ end
+ it "handles inaccessible paths correctly" do
+ run_command 'hscript-printowner /root/foo'
+ expect(last_command_started.stderr).to include("Permission denied")
+ end
+ it "handles nonexistent paths correctly" do
+ run_command 'hscript-printowner /nonexistent'
+ expect(last_command_started.stderr).to include("No such file or directory")
+ end
+ it "handles normal paths correctly" do
+ run_command 'hscript-printowner /'
+ expect(last_command_started.stdout).to eq("0\n")
+ end
+end