spec/integration/cli_general_spec.rb in inqlude-0.7.1 vs spec/integration/cli_general_spec.rb in inqlude-0.7.2
- old
+ new
@@ -1,8 +1,9 @@
require_relative "spec_helper"
include CliTester
+include GivenFilesystemSpecHelpers
describe "Command line interface" do
describe "shows error" do
it "when command does not exist" do
expect(run_command(args: ["abc"])).to exit_with_success("", /abc/)
@@ -12,8 +13,28 @@
expect(run_command(args: ["--abc"])).to exit_with_success("", /--abc/)
end
it "when command option does not exist" do
expect(run_command(args: ["list", "--abc"])).to exit_with_success("", /--abc/)
+ end
+ end
+
+ describe "global options" do
+ use_given_filesystem
+
+ it "recognizes --offline option" do
+ dir = given_directory do
+ given_directory_from_data("awesomelib")
+ end
+
+ # This doesn't make much sense to a user, but that's what it is right now.
+ # It will go away when we switched to GLI
+ expected_stderr = <<-EOT
+ERROR: "inqlude global" was called with arguments ["list"]
+Usage: "inqlude global"
+ EOT
+
+ expect(run_command(args: ["--offline", "list", "--manifest_dir=#{dir}"]))
+ .to exit_with_success("", expected_stderr)
end
end
end