summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-12-27 16:25:28 -0700
committermo khan <mo.khan@gmail.com>2019-12-27 16:25:28 -0700
commitb771f43fdac2a0d5b643c08387e7ca45166a34fe (patch)
tree0500865905c9078f8abfa8e76866fc386952161b /spec
parent2d87d15728e45f7a7dc4ab4f2bab6881712644eb (diff)
Add scan command
Diffstat (limited to 'spec')
-rw-r--r--spec/integration/scan_spec.rb16
-rw-r--r--spec/unit/scan_spec.rb13
2 files changed, 29 insertions, 0 deletions
diff --git a/spec/integration/scan_spec.rb b/spec/integration/scan_spec.rb
new file mode 100644
index 0000000..678da1f
--- /dev/null
+++ b/spec/integration/scan_spec.rb
@@ -0,0 +1,16 @@
+RSpec.describe "`spandx scan` command", type: :cli do
+ it "executes `spandx help scan` command successfully" do
+ output = `spandx help scan`
+ expected_output = <<-OUT
+Usage:
+ spandx scan
+
+Options:
+ -h, [--help], [--no-help] # Display usage information
+
+Command description...
+ OUT
+
+ expect(output).to eq(expected_output)
+ end
+end
diff --git a/spec/unit/scan_spec.rb b/spec/unit/scan_spec.rb
new file mode 100644
index 0000000..812b765
--- /dev/null
+++ b/spec/unit/scan_spec.rb
@@ -0,0 +1,13 @@
+require 'spandx/commands/scan'
+
+RSpec.describe Spandx::Commands::Scan do
+ it "executes `scan` command successfully" do
+ output = StringIO.new
+ options = {}
+ command = Spandx::Commands::Scan.new(options)
+
+ command.execute(output: output)
+
+ expect(output.string).to eq("OK\n")
+ end
+end