spec/alvid_spec.rb in alvid-0.1.0 vs spec/alvid_spec.rb in alvid-0.2.0
- old
+ new
@@ -5,12 +5,18 @@
expect(Alvid::VERSION).not_to be nil
end
describe 'init' do
describe 'when VCAP_SERVICES provided' do
- it 'uses provided db' do
+ it 'supports p-mysql' do
ENV["VCAP_SERVICES"] = '{ "p-mysql-n/a": [ { "credentials": { "uri":"cool-mysql-uri" }, "label": "p-mysql-n/a", "name": "p-mysql", "syslog_drain_url": "", "tags": ["postgres","postgresql","relational"] } ] } '
expect(DataMapper).to receive(:setup).with(:default, "cool-mysql-uri")
+ Alvid.init
+ ENV.clear
+ end
+ it 'supports cleardb' do
+ ENV["VCAP_SERVICES"] = ' { "cleardb": [ { "name": "alvid", "label": "cleardb", "tags": [], "plan": "spark", "credentials": { "uri": "mysql://USER:PASSWORD@cleardb.net:3306/DBNAME?reconnect=true" } } ] }'
+ expect(DataMapper).to receive(:setup).with(:default, "mysql://USER:PASSWORD@cleardb.net:3306/DBNAME?reconnect=true")
Alvid.init
ENV.clear
end
end