-
Notifications
You must be signed in to change notification settings - Fork 0
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
11 changed files
with
281 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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module Dashboard | ||
describe Fetcher do | ||
before :each do | ||
Redis.new.flushall | ||
end | ||
|
||
after :all do | ||
Redis.new.flushall | ||
end | ||
|
||
it 'stores a value in Redis', :vcr do | ||
url = 'https://raw.githubusercontent.com/pikesley/snake-data/master/length.csv' | ||
described_class.get(url) | ||
expect(Marshal.load(Redis.new.get(url))).to eq( | ||
"""\ | ||
Date,Length in m | ||
2014-09-30,0.45 | ||
2014-10-09,0.50 | ||
2014-10-18,0.50 | ||
2014-12-12,0.55 | ||
2015-01-11,0.60 | ||
2015-01-28,0.65 | ||
2015-08-27,0.95 | ||
""" | ||
) | ||
end | ||
|
||
it 'expires a value after the timeout', :vcr do | ||
url = 'https://api.github.com/repos/pikesley/catface/contents/flea-treatment.csv?ref=master' | ||
described_class.get(url, 1) | ||
expect(Redis.new.get url).to_not be nil | ||
expect(Redis.new.ttl url).to eq 1 | ||
sleep 1 | ||
expect(Redis.new.get url).to be nil | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,5 +0,0 @@ | ||
describe('ago', function() { | ||
it('knows a thing was a month ago', function() { | ||
Timecop.install() | ||
}) | ||
}) | ||
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
72 changes: 72 additions & 0 deletions
72
spec/support/vcr/Dashboard_Fetcher/expires_a_value_after_an_hour.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
spec/support/vcr/Dashboard_Fetcher/expires_a_value_after_the_timeout.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
spec/support/vcr/Dashboard_Fetcher/stores_a_value_in_Redis.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.