Sha256: 0c1e1a2e444d7444bf8d9e5678b03c63835253a442de5889d79431f510cee7c4

Contents?: true

Size: 686 Bytes

Versions: 5

Compression:

Stored size: 686 Bytes

Contents

# Encoding: utf-8

require 'spec_helper'
require 'chemistrykit/split_testing/provider_factory'

describe ChemistryKit::SplitTesting::ProviderFactory do

  let(:config) { double 'ChemistryKit::Config::SplitTesting' }

  it 'should determine what kind of provider to build' do
    config.should_receive(:provider).and_return('optimizely')
    ChemistryKit::SplitTesting::ProviderFactory.build(config)
  end

  it 'should raise an error for an un known provider' do
    config.should_receive(:provider).twice.and_return('bad')
    expect do
      ChemistryKit::SplitTesting::ProviderFactory.build(config)
    end.to raise_error(ArgumentError, 'The provider: "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/split_testing/provider_factory_spec.rb
chemistrykit-3.10.0 spec/unit/lib/chemistrykit/split_testing/provider_factory_spec.rb
chemistrykit-3.9.1 spec/unit/lib/chemistrykit/split_testing/provider_factory_spec.rb
chemistrykit-3.9.0 spec/unit/lib/chemistrykit/split_testing/provider_factory_spec.rb
chemistrykit-3.9.0.rc3 spec/unit/lib/chemistrykit/split_testing/provider_factory_spec.rb