Sha256: c5e6e1fb7f50a3cef3b0381b761125cd6b90baa4a9ab5c0dc8fa6b53b6c2d57d

Contents?: true

Size: 899 Bytes

Versions: 2

Compression:

Stored size: 899 Bytes

Contents

require 'spec_helper'
require 'split/dashboard/helpers'

include Split::DashboardHelpers

describe Split::DashboardHelpers do
  describe 'confidence_level' do
    it 'should handle very small numbers' do
      confidence_level(Complex(2e-18, -0.03)).should eql('Insufficient confidence')
    end

    it "should consider a z-score of 1.65 <= z < 1.96 as 90% confident" do
      confidence_level(1.65).should eql('90% confidence')
      confidence_level(1.80).should eql('90% confidence')
    end

    it "should consider a z-score of 1.96 <= z < 2.58 as 95% confident" do
      confidence_level(1.96).should eql('95% confidence')
      confidence_level(2.00).should eql('95% confidence')
    end

    it "should consider a z-score of z >= 2.58 as 95% confident" do
      confidence_level(2.58).should eql('99% confidence')
      confidence_level(3.00).should eql('99% confidence')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
split-0.7.1 spec/dashboard_helpers_spec.rb
split-0.7.0 spec/dashboard_helpers_spec.rb