require "spec_helper" describe SimControl::Controller do describe "#execute" do it "creates a new controller instance and runs it with the called arguments" do hostname = "a-hostname" simulation_description = double("simulation_description") scenario_description = double("scenario_description") results_directory = double("results_directory") instance = double(SimControl::Controller) SimControl::Controller.should_receive(:new).with(hostname, simulation_description, scenario_description, results_directory).and_return(instance) instance.should_receive(:run) SimControl::Controller.execute(hostname, simulation_description, scenario_description, results_directory) end it "calls methods called from the simulation description on the controller instance" do simulation_description = <