spec/admin/service_broker/update_spec.rb in cf-5.2.1.rc7 vs spec/admin/service_broker/update_spec.rb in cf-5.2.1.rc8
- old
+ new
@@ -7,18 +7,22 @@
let(:client) { build(:client) }
let(:service_broker) { CFoundry::V2::ServiceBroker.new(nil, client) }
before do
+ service_broker.name = 'formername'
+ service_broker.broker_url = 'http://former.example.com'
+ service_broker.token = 'formertoken'
+
CFAdmin::ServiceBroker::Update.client = client
- client.stub(:service_broker_by_name).with('cf-mysql').and_return(service_broker)
+ client.stub(:service_broker_by_name).with('formername').and_return(service_broker)
end
it "updates a service broker when arguments are provided on the command line" do
service_broker.stub(:update!)
- cf %W[update-service-broker --broker cf-mysql --name cf-othersql --url http://other.cfapp.io --token secret2]
+ cf %W[update-service-broker --broker formername --name cf-othersql --url http://other.cfapp.io --token secret2]
service_broker.name.should == 'cf-othersql'
service_broker.broker_url.should == 'http://other.cfapp.io'
service_broker.token.should == 'secret2'
@@ -26,14 +30,14 @@
end
it "updates a service broker when no change arguments are provided" do
service_broker.stub(:update!)
- stub_ask("Name").and_return("cf-othersql")
- stub_ask("URL").and_return("http://other.example.com")
- stub_ask("Token").and_return("token2")
+ stub_ask("Name", :default => 'formername').and_return("cf-othersql")
+ stub_ask("URL", :default => 'http://former.example.com').and_return("http://other.example.com")
+ stub_ask("Token", :default => 'formertoken').and_return("token2")
- cf %W[update-service-broker cf-mysql]
+ cf %W[update-service-broker formername]
service_broker.name.should == 'cf-othersql'
service_broker.broker_url.should == 'http://other.example.com'
service_broker.token.should == 'token2'