-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,12 @@ | |
|
||
describe Stream::Client do | ||
before do | ||
@env_url = ENV['STREAM_URL'] | ||
@env_url = ENV.fetch('STREAM_URL') | ||
end | ||
|
||
after do | ||
ENV.delete 'STREAM_URL' | ||
ENV['STREAM_URL'] = @env_url if @env_url | ||
ENV.fetch('STREAM_URL') = @env_url if @env_url | ||
end | ||
|
||
it 'feed returns a Feed instance with id' do | ||
|
@@ -41,7 +41,7 @@ | |
end | ||
|
||
it 'on heroku we connect using environment variables' do | ||
ENV['STREAM_URL'] = 'https://thierry:[email protected]/?app_id=1' | ||
ENV.fetch('STREAM_URL') = 'https://thierry:[email protected]/?app_id=1' | ||
client = Stream::Client.new | ||
expect(client.api_key).to eq 'thierry' | ||
expect(client.api_secret).to eq 'pass' | ||
|
@@ -51,7 +51,7 @@ | |
end | ||
|
||
it 'old heroku url' do | ||
ENV['STREAM_URL'] = 'https://thierry:[email protected]/?app_id=1' | ||
ENV.fetch('STREAM_URL') = 'https://thierry:[email protected]/?app_id=1' | ||
client = Stream::Client.new | ||
expect(client.api_key).to eq 'thierry' | ||
expect(client.api_secret).to eq 'pass' | ||
|
@@ -61,7 +61,7 @@ | |
end | ||
|
||
it 'heroku url with location' do | ||
ENV['STREAM_URL'] = 'https://thierry:[email protected]/?app_id=1' | ||
ENV.fetch('STREAM_URL') = 'https://thierry:[email protected]/?app_id=1' | ||
client = Stream::Client.new | ||
expect(client.api_key).to eq 'thierry' | ||
expect(client.api_secret).to eq 'pass' | ||
|
@@ -71,7 +71,7 @@ | |
end | ||
|
||
it 'heroku with getstream.io url with location' do | ||
ENV['STREAM_URL'] = 'https://thierry:[email protected]/?app_id=1' | ||
ENV.fetch('STREAM_URL') = 'https://thierry:[email protected]/?app_id=1' | ||
client = Stream::Client.new | ||
expect(client.api_key).to eq 'thierry' | ||
expect(client.api_secret).to eq 'pass' | ||
|
@@ -81,7 +81,7 @@ | |
end | ||
|
||
it 'heroku url with location and extra vars' do | ||
ENV['STREAM_URL'] = 'https://thierry:[email protected]/?something_else=2&app_id=1&something_more=3' | ||
ENV.fetch('STREAM_URL') = 'https://thierry:[email protected]/?something_else=2&app_id=1&something_more=3' | ||
client = Stream::Client.new | ||
expect(client.api_key).to eq 'thierry' | ||
expect(client.api_secret).to eq 'pass' | ||
|
@@ -91,12 +91,12 @@ | |
end | ||
|
||
it 'wrong heroku vars' do | ||
ENV['STREAM_URL'] = 'https://thierry:[email protected]/?a=1' | ||
ENV.fetch('STREAM_URL') = 'https://thierry:[email protected]/?a=1' | ||
expect { Stream::Client.new }.to raise_error(ArgumentError) | ||
end | ||
|
||
it 'but overwriting environment variables should be possible' do | ||
ENV['STREAM_URL'] = 'https://thierry:[email protected]/?app_id=1' | ||
ENV.fetch('STREAM_URL') = 'https://thierry:[email protected]/?app_id=1' | ||
client = Stream::Client.new('1', '2', '3') | ||
expect(client.api_key).to eq '1' | ||
expect(client.api_secret).to eq '2' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters