spec/shelly/app_spec.rb in shelly-0.0.46.pre3 vs spec/shelly/app_spec.rb in shelly-0.0.46.pre4
- old
+ new
@@ -291,21 +291,28 @@
describe "#run" do
before do
@response = {
"result" => "4"
}
- @client.stub(:run).and_return(@response)
+ @client.stub(:command).and_return(@response)
File.open("to_run.rb", 'w') {|f| f.write("User.count\n") }
end
it "should return result of executed code" do
- @client.should_receive(:run).with("foo-staging", "2 + 2")
+ @client.should_receive(:command).with("foo-staging", "2 + 2", :ruby)
@app.run("2 + 2").should == "4"
end
it "should send contents of file when file exists" do
- @client.should_receive(:run).with("foo-staging", "User.count\n")
+ @client.should_receive(:command).with("foo-staging", "User.count\n", :ruby)
@app.run("to_run.rb")
+ end
+ end
+
+ describe "#rake" do
+ it "should return result of rake task" do
+ @client.should_receive(:command).with("foo-staging", "db:create", :rake).and_return({"result" => "OK"})
+ @app.rake("db:create").should == "OK"
end
end
describe "#to_s" do
it "should return code_name" do