-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some REPL Driven Development to fix bug - TODO: fix broken test
- Loading branch information
1 parent
6eb5f8c
commit 7fd905e
Showing
2 changed files
with
23 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'sinderella' | ||
|
||
data = { :key => 'value' } | ||
till_midnight = 60 | ||
|
||
id = Sinderella.transforms(data, till_midnight) do |data| | ||
data.each do |key, value| | ||
data.tap { |d| d[key].upcase! } | ||
end | ||
end | ||
|
||
puts Sinderella.get(id) | ||
|
||
puts "Resetting data early" and Sinderella.midnight(id) if (rand() * 2).to_i == 1 # randomly reset the data early... | ||
|
||
sleep 10 | ||
|
||
puts Sinderella.get(id) | ||
|
||
sleep 60 | ||
|
||
puts Sinderella.get(id) |
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