spec/algorithms/whiplash_spec.rb in split-0.7.2 vs spec/algorithms/whiplash_spec.rb in split-0.7.3

- old
+ new

@@ -2,22 +2,22 @@ describe Split::Algorithms::Whiplash do it "should return an algorithm" do experiment = Split::Experiment.find_or_create('link_color', {'blue' => 1}, {'red' => 1 }) - Split::Algorithms::Whiplash.choose_alternative(experiment).class.should == Split::Alternative + expect(Split::Algorithms::Whiplash.choose_alternative(experiment).class).to eq(Split::Alternative) end it "should return one of the results" do experiment = Split::Experiment.find_or_create('link_color', {'blue' => 1}, {'red' => 1 }) - ['red', 'blue'].should include Split::Algorithms::Whiplash.choose_alternative(experiment).name + expect(['red', 'blue']).to include Split::Algorithms::Whiplash.choose_alternative(experiment).name end it "should guess floats" do - Split::Algorithms::Whiplash.send(:arm_guess, 0, 0).class.should == Float - Split::Algorithms::Whiplash.send(:arm_guess, 1, 0).class.should == Float - Split::Algorithms::Whiplash.send(:arm_guess, 2, 1).class.should == Float - Split::Algorithms::Whiplash.send(:arm_guess, 1000, 5).class.should == Float - Split::Algorithms::Whiplash.send(:arm_guess, 10, -2).class.should == Float + expect(Split::Algorithms::Whiplash.send(:arm_guess, 0, 0).class).to eq(Float) + expect(Split::Algorithms::Whiplash.send(:arm_guess, 1, 0).class).to eq(Float) + expect(Split::Algorithms::Whiplash.send(:arm_guess, 2, 1).class).to eq(Float) + expect(Split::Algorithms::Whiplash.send(:arm_guess, 1000, 5).class).to eq(Float) + expect(Split::Algorithms::Whiplash.send(:arm_guess, 10, -2).class).to eq(Float) end -end \ No newline at end of file +end