require 'spec_helper' describe Flombe do let(:runner) { Flombe::Runner.new } it "should detect if xcode is missing" do runner.stub!(:xcode?).and_return(false) lambda { runner.run }.should raise_error(Flombe::MissingXCodeError) end it "should detect Mac OS X verson" do runner.stub!(:macosx_version).and_return(10.5) lambda { runner.run }.should raise_error(Flombe::BadMacOSXVersionError) end it "should detect that a Flombefile does not exist" do runner.stub!(:flombefile?).and_return(false) lambda { runner.run }.should raise_error(Flombe::NoFlombefileError) end it "should detect if it's trying to be run as root" do runner.stub!(:root?).and_return(true) lambda { runner.run }.should raise_error(Flombe::RunningAsRootError) end it "should run chef-solo" do runner.should_receive(:run_chef) runner.run end end