Sha256: d5d82ba7a96578da64dcfddf87a253d9c8593aacd1833d18734ef06afd264a2d

Contents?: true

Size: 943 Bytes

Versions: 5

Compression:

Stored size: 943 Bytes

Contents

# Encoding: utf-8

require 'spec_helper'
require 'chemistrykit/config/split_testing'

describe ChemistryKit::Config::SplitTesting do

  VALID_PROVIDER = 'optimizely'

  before(:each) do
    @opts = { provider: VALID_PROVIDER, opt_out: true, base_url: 'http://google.com'
      }
      @split_testing = ChemistryKit::Config::SplitTesting.new(@opts)
  end

  it 'should be initialized with an hash of options' do
    @split_testing.should be_an_instance_of ChemistryKit::Config::SplitTesting
  end

  it 'should get the basic configuration values' do
    @split_testing.provider.should eq VALID_PROVIDER
    @split_testing.base_url.should eq 'http://google.com'
    @split_testing.opt_out?.should be_true
  end

  it 'should raise an error for invalid config parameters' do
    expect do
      ChemistryKit::Config::SplitTesting.new(@opts.merge(bad: 'value'))
    end.to raise_error(ArgumentError, 'The config key: "bad" is unknown!')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chemistrykit-3.10.1 spec/unit/lib/chemistrykit/config/split_testing_spec.rb
chemistrykit-3.10.0 spec/unit/lib/chemistrykit/config/split_testing_spec.rb
chemistrykit-3.9.1 spec/unit/lib/chemistrykit/config/split_testing_spec.rb
chemistrykit-3.9.0 spec/unit/lib/chemistrykit/config/split_testing_spec.rb
chemistrykit-3.9.0.rc3 spec/unit/lib/chemistrykit/config/split_testing_spec.rb