spec/environments/python_environment_spec.rb in SimControl-0.1.2 vs spec/environments/python_environment_spec.rb in SimControl-0.1.3

- old
+ new

@@ -21,15 +21,10 @@ it "calls the script if nothing is passed in args" do simulation = SimControl::PythonEnvironment.new script expect(simulation.script).to eq("a-script") end - it "passes args to the script in -- syntax" do - simulation = SimControl::PythonEnvironment.new script - expect(simulation.args({foo: "bar", baz: 1})).to eq("--foo bar --baz 1") - end - it "uses a given interpreter" do simulation = SimControl::PythonEnvironment.new script, interpreter: "pypy" expect(simulation.interpreter).to eq("pypy") end @@ -38,12 +33,13 @@ expect(simulation.interpreter).to eq("foo/bar/bin/pypy") end it "composes the command" do simulation = SimControl::PythonEnvironment.new script - simulation.stub(:args).and_return "--args 1" + scenario = double("scenario") + scenario.should_receive(:args).and_return("--args 1") simulation.stub(:interpreter).and_return "/foo/jpython" - expect(simulation.command(args: 1)).to eq("/foo/jpython a-script --args 1") + expect(simulation.command(scenario)).to eq("/foo/jpython a-script --args 1") end it "raised an exception is a virtualenv is passed but no interpreter" do expect do SimControl::PythonEnvironment.new script, virtualenv: "foo/bar"