test/experiment_test.rb in verdict-0.2.0 vs test/experiment_test.rb in verdict-0.2.1
- old
+ new
@@ -1,9 +1,9 @@
require 'json'
require 'test_helper'
-class ExperimentTest < MiniTest::Unit::TestCase
+class ExperimentTest < Minitest::Test
def test_no_qualifier
e = Verdict::Experiment.new('test')
assert !e.has_qualifier?
assert e.everybody_qualifies?
@@ -107,11 +107,11 @@
qualified_assignment = e.subject_assignment(mock('identifier'), e.group(:all), Time.now)
mock_qualifier.expects(:qualifies?).returns(true)
mock_store.expects(:retrieve_assignment).returns(qualified_assignment).once
mock_store.expects(:store_assignment).never
e.assign(mock('subject'))
- end
+ end
def test_new_unqualified_assignment_with_store_unqualified
mock_store, mock_qualifier = Verdict::Storage::MockStorage.new, mock('qualifier')
e = Verdict::Experiment.new('test') do
qualify { mock_qualifier.qualifies? }
@@ -200,11 +200,11 @@
logger.expects(:log_conversion).with(kind_of(Verdict::Conversion))
e.segmenter.expects(:conversion_feedback).with('test_subject', subject, kind_of(Verdict::Conversion))
conversion = e.convert(subject, :my_goal)
assert_equal 'test_subject', conversion.subject_identifier
- assert_equal :my_goal, conversion.goal
+ assert_equal :my_goal, conversion.goal
end
def test_json
e = Verdict::Experiment.new(:json) do
name 'testing'
@@ -306,7 +306,16 @@
assert !e.started?, "The experiment should not have started yet"
e.assign(stub(id: '123'))
assert e.started?, "The experiment should have started after the first assignment"
+ end
+
+ def test_no_storage
+ e = Verdict::Experiment.new('starting_test') do
+ groups { group :all, 100 }
+ storage :none
+ end
+
+ assert_kind_of Verdict::Storage::MockStorage, e.storage
end
end