Sha256: 6249cafb11f128b4cbc3533e0d22a643fb932c0287e110913b941fd9aea8f912

Contents?: true

Size: 950 Bytes

Versions: 12

Compression:

Stored size: 950 Bytes

Contents

# frozen_string_literal: true
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
      expect(confidence_level(Complex(2e-18, -0.03))).to eq('Insufficient confidence')
    end

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

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

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
split-2.2.0 spec/dashboard_helpers_spec.rb
split-2.1.0 spec/dashboard_helpers_spec.rb
split-2.0.0 spec/dashboard_helpers_spec.rb
split-1.7.0 spec/dashboard_helpers_spec.rb
split-1.6.0 spec/dashboard_helpers_spec.rb
split-1.5.0 spec/dashboard_helpers_spec.rb
split-1.4.5 spec/dashboard_helpers_spec.rb
split-1.4.4 spec/dashboard_helpers_spec.rb
split-1.4.3 spec/dashboard_helpers_spec.rb
split-1.4.2 spec/dashboard_helpers_spec.rb
split-1.4.1 spec/dashboard_helpers_spec.rb
split-1.4.0 spec/dashboard_helpers_spec.rb