spec/shelly/app_spec.rb in shelly-0.0.50.pre2 vs spec/shelly/app_spec.rb in shelly-0.0.50
- old
+ new
@@ -10,32 +10,13 @@
@app = Shelly::App.new
@app.code_name = "foo-staging"
end
describe ".guess_code_name" do
- context "no Cloudfile" do
- it "should return name of current working directory" do
- Shelly::App.guess_code_name.should == "foo-staging"
- end
+ it "should return name of current working directory" do
+ Shelly::App.guess_code_name.should == "foo"
end
-
- context "with Cloudfile" do
- it "should return production" do
- File.open("Cloudfile", 'w') {|f| f.write("foo-staging:\n") }
- Shelly::App.guess_code_name.should == "foo-production"
- end
-
- it "should return production" do
- File.open("Cloudfile", 'w') {|f| f.write("winnie-test:\n") }
- Shelly::App.guess_code_name.should == "foo-staging"
- end
-
- it "should return productionNUMBER" do
- File.open("Cloudfile", 'w') {|f| f.write("foo-staging:\nfoo-production:\n") }
- Shelly::App.guess_code_name.should == "foo-production1"
- end
- end
end
describe "#collaborations" do
it "should fetch app's users" do
@client.should_receive(:collaborations).with("foo-staging")
@@ -48,24 +29,16 @@
@app.stub(:git_url).and_return("git@git.shellycloud.com:foo-staging.git")
@app.stub(:system)
end
it "should try to remove existing git remote" do
- @app.should_receive(:system).with("git remote rm foo-staging > /dev/null 2>&1")
+ @app.should_receive(:system).with("git remote rm production > /dev/null 2>&1")
@app.add_git_remote
end
it "should add git remote with proper name and git repository" do
- @app.should_receive(:system).with("git remote add foo-staging git@git.shellycloud.com:foo-staging.git")
+ @app.should_receive(:system).with("git remote add production git@git.shellycloud.com:foo-staging.git")
@app.add_git_remote
- end
- end
-
- describe "git_remote_exist" do
- it "should return true if git remote exist" do
- io = mock(:read => "origin\nfoo-staging")
- IO.should_receive(:popen).with("git remote").and_return(io)
- @app.git_remote_exist?.should be_true
end
end
describe "#configs" do
it "should get configs from client" do