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.
@@ -84,7 +84,7 @@ module SplitCat
84
84
 
85
85
  before( :each ) do
86
86
  @total_weight = experiment.total_weight
87
- experiment.should_receive( :rand ).with( @total_weight ).and_return( 1 )
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
- experiment.choose_hypothesis.should eql( experiment.hypotheses.first )
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: split_cat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rich Humphrey