test/storage/redis_storage_test.rb in verdict-0.11.0 vs test/storage/redis_storage_test.rb in verdict-0.12.0
- old
+ new
@@ -69,17 +69,29 @@
a = @experiment.send(:ensure_experiment_has_started)
assert @redis.hexists(experiment_key, "started_at")
assert_equal a, @experiment.started_at
end
- def test_cleanup
+ def test_cleanup_with_scope_argument
1000.times do |n|
@experiment.assign("something_#{n}")
end
assert_operator @redis, :exists, experiment_key
+ Verdict.default_logger.expects(:warn).with(regexp_matches(/deprecated/))
@storage.cleanup(:redis_storage)
+ refute_operator @redis, :exists, experiment_key
+ end
+
+ def test_cleanup
+ 1000.times do |n|
+ @experiment.assign("something_#{n}")
+ end
+
+ assert_operator @redis, :exists, experiment_key
+
+ @storage.cleanup(@experiment)
refute_operator @redis, :exists, experiment_key
end
private