spec/nachos_spec.rb in nachos-0.0.1 vs spec/nachos_spec.rb in nachos-0.0.2

- old
+ new

@@ -1,4 +1,29 @@ require 'spec_helper' describe Nachos do + describe "execute" do + it "calls start on CLI" do + Nachos::CLI.expects(:start) + + nachos = Nachos.new + nachos.stubs(:exit) + nachos.execute + end + + it "exits successfully" do + Nachos::CLI.stubs(:start) + nachos = Nachos.new + nachos.expects(:exit).with(0) + nachos.execute + end + + it "can do help" do + begin + Nachos::CLI.any_instance.stubs(:shell).returns(shell = stub_everything()) + Nachos.execute("help") + rescue SystemExit => e + end + end + end + end