split_cat 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/split_cat/experiment.rb +9 -3
- data/lib/split_cat/version.rb +1 -1
- data/spec/dummy/log/test.log +6016 -0
- data/spec/models/split_cat/experiment_spec.rb +3 -2
- metadata +1 -1
@@ -84,7 +84,7 @@ module SplitCat
|
|
84
84
|
|
85
85
|
before( :each ) do
|
86
86
|
@total_weight = experiment.total_weight
|
87
|
-
experiment.
|
87
|
+
experiment.stub( :rand ).with( @total_weight ).and_return( 1 )
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'generates a random number in range of total hypothesis weight' do
|
@@ -92,7 +92,8 @@ module SplitCat
|
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'chooses a hypothesis by weight' do
|
95
|
-
|
95
|
+
Kernel.stub( :rand ).and_return( experiment.hypotheses[ 0 ].weight )
|
96
|
+
experiment.choose_hypothesis.should eql( experiment.hypotheses[ 1 ] )
|
96
97
|
end
|
97
98
|
|
98
99
|
it 'returns the chosen hypothesis' do
|