spec/integration/yard/sinclair/env_settable_spec.rb in sinclair-2.0.1 vs spec/integration/yard/sinclair/env_settable_spec.rb in sinclair-2.1.0
- old
+ new
@@ -2,44 +2,25 @@
require 'spec_helper'
describe Sinclair::EnvSettable do
describe '#yard' do
- subject(:settable) { Class.new(MyAppClient) }
+ subject(:settable) { MyAppClient }
before do
ENV['MY_APP_USERNAME'] = 'my_login'
+ ENV['MY_APP_PORT'] = '8080'
end
after do
ENV.delete('MY_APP_USERNAME')
+ ENV.delete('MY_APP_PORT')
end
- it 'retrieves username from env' do
+ it 'retrieves data from env' do
expect(settable.username).to eq('my_login')
- end
-
- it 'retrieves password from env' do
expect(settable.password).to be_nil
- end
-
- context 'when defining defaults' do
- it 'returns default value' do
- expect(settable.host).to eq('my-host.com')
- end
-
- context 'when setting the env variable' do
- before do
- ENV['MY_APP_HOST'] = 'other-host.com'
- end
-
- after do
- ENV.delete('MY_APP_HOST')
- end
-
- it 'retrieves host from env' do
- expect(settable.host).to eq('other-host.com')
- end
- end
+ expect(settable.host).to eq('my-host.com')
+ expect(settable.port).to eq(8080)
end
end
end