spec/hobo/cli_spec.rb in hobo-inviqa-0.0.9.pre.rc1 vs spec/hobo/cli_spec.rb in hobo-inviqa-0.0.9.pre.rc2

- old
+ new

@@ -14,20 +14,19 @@ task.clear end Hobo.ui = double(Hobo::Ui).as_null_object help = double(Hobo::HelpFormatter).as_null_object - cli = Hobo::Cli.new help: help + host_check = double(Hobo::Lib::HostCheck).as_null_object + cli = Hobo::Cli.new help: help, host_check: host_check hobofile = File.read(File.join(File.dirname(__FILE__), '../../Hobofile')) Hobo.project_path = nil FakeFS.activate! File.write('Hobofile', hobofile) - - double(Hobo::Lib::HostCheck).as_null_object end after do FakeFS::FileSystem.clear FakeFS.deactivate! @@ -100,15 +99,10 @@ allow(help).to receive("command_map=") { |i| map = i } cli.start test_args([]) map["test:metadata"].hidden.should be true end - it "should set non-interactive mode in ui if --non-interactive" do - Hobo.ui.should_receive('interactive=').with(false) - cli.start(test_args(['--non-interactive'])) - end - it "should show help if no args or opts passed" do help.should_receive(:help) cli.start(test_args([])) end @@ -151,16 +145,10 @@ Hobo.ui.should_receive(:info).with("1234") cli.start test_args(["test", "argument-test", "1234"]) end it "should propagate unparsed arguments in :_unparsed opt" do - Hobo.ui.should_receive(:info).with("ls --help") - cli.slop.unparsed = "ls --help" - cli.start test_args(["test", "unparsed", "--skip-host-checks"]) - end - - it "should propagate unparsed arguments in :_unparsed opt" do - Hobo.ui.should_receive(:info).with("ls --help") + Hobo.ui.should_receive(:info).with("'ls' '--help'") cli.start ["test", "unparsed", "--", "ls", "--help"] end it "should raise an exception if not enough arguments were passed" do expect { cli.start(test_args(["test", "metadata"])) }.to raise_error Hobo::MissingArgumentsError