split 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76d9f44d0d50f07ea46e299f93bbb5bdb1333b8b
4
- data.tar.gz: 40e88a5a32652b2acbd049562810fb8c8da03da4
3
+ metadata.gz: c5fbcc8e3abf30d53af50aa09b77ceab245d58a1
4
+ data.tar.gz: 0b576e850d6d066a06aaf599b0970622f22c1041
5
5
  SHA512:
6
- metadata.gz: c77ff217b8bdf985904c5949b7d401b479e516d6035f1e94ed50aebab5637bf3df9b9d4d22f9aa815a2c8f3a6d54c4cca66a71d4b43aa47c981ffda530a07d8f
7
- data.tar.gz: 3bcacf988dbe704ca2460e681a1f0531fa1ca47486c4239d6e6db38234226b23186d55787e7bafefc8cfa9aeff12ce0400bbc6b1a83ed6166e89c9fca491711c
6
+ metadata.gz: 9a05fd38b874ffa595a76445673c3916c9d00835b641b17416fc41e48eadb731c13377e886889dbecc90aa88c1f2a6264ae11cdb33d9a41043ffde999355b8b1
7
+ data.tar.gz: 6491c8f886f1b90e90df207103c2fd52c545ae3f9219f1e43f10c67f2d4b15d57542eb7cb27ace064e58f9163f20938dbeb89d7a115b91ed205e28716f7e04dc
@@ -1,13 +1,38 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 1.9.3
4
+ - 2.0
5
+ - 2.1
6
+ - 2.2.0
7
+ - 2.2.2
3
8
  - 2.4.1
4
9
 
5
10
  gemfile:
6
11
  - gemfiles/4.2.gemfile
7
12
  - gemfiles/5.0.gemfile
13
+ - gemfiles/5.1.gemfile
14
+
15
+ matrix:
16
+ exclude:
17
+ - rvm: 1.9.3
18
+ gemfile: gemfiles/5.0.gemfile
19
+ - rvm: 1.9.3
20
+ gemfile: gemfiles/5.1.gemfile
21
+ - rvm: 2.0
22
+ gemfile: gemfiles/5.0.gemfile
23
+ - rvm: 2.0
24
+ gemfile: gemfiles/5.1.gemfile
25
+ - rvm: 2.1
26
+ gemfile: gemfiles/5.0.gemfile
27
+ - rvm: 2.1
28
+ gemfile: gemfiles/5.1.gemfile
29
+ - rvm: 2.2.0
30
+ gemfile: gemfiles/5.0.gemfile
31
+ - rvm: 2.2.0
32
+ gemfile: gemfiles/5.1.gemfile
8
33
 
9
34
  before_install:
10
- - gem install bundler
35
+ - gem update --system && gem install bundler
11
36
 
12
37
  script:
13
38
  - RAILS_ENV=test bundle exec rake spec && bundle exec codeclimate-test-reporter
@@ -1,3 +1,13 @@
1
+ ## 3.1.1 (August 30th, 2017)
2
+
3
+ Bugfixes:
4
+
5
+ - Bring back support for ruby 1.9.3 and greater (rubygems 2.0.0 or greater now required) (@patbl, #498)
6
+
7
+ Misc:
8
+
9
+ - Document testing with RSpec (@eliotsykes, #495)
10
+
1
11
  ## 3.1.0 (August 14th, 2017)
2
12
 
3
13
  Features:
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [Split](http://libraries.io/rubygems/split)
1
+ # [Split](http://libraries.io/rubygems/split)
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/split.svg)](http://badge.fury.io/rb/split)
4
4
  [![Build Status](https://secure.travis-ci.org/splitrb/split.svg?branch=master)](http://travis-ci.org/splitrb/split)
@@ -18,7 +18,7 @@ Split is designed to be hacker friendly, allowing for maximum customisation and
18
18
 
19
19
  ### Requirements
20
20
 
21
- Split currently requires Ruby 1.9.2 or higher. If your project requires compatibility with Ruby 1.8.x and Rails 2.3, please use v0.8.0.
21
+ Split currently requires Ruby 1.9.3 or higher. If your project requires compatibility with Ruby 1.8.x and Rails 2.3, please use v0.8.0.
22
22
 
23
23
  Split uses Redis as a datastore.
24
24
 
@@ -150,6 +150,36 @@ In the event you want to disable all tests without having to know the individual
150
150
 
151
151
  It is not required to send `SPLIT_DISABLE=false` to activate Split.
152
152
 
153
+ To aid testing with RSpec, write `split_helper.rb` and call `use_ab_test(alternatives_by_experiment)` in your specs as instructed below:
154
+
155
+ ```ruby
156
+ # Recommended path for this file is 'spec/support/split_helper.rb', and you will need to ensure it
157
+ # is `require`-d by rails_helper.rb or spec_helper.rb
158
+ module SplitHelper
159
+
160
+ # Usage:
161
+ #
162
+ # Force a specific experiment alternative to always be returned:
163
+ # use_ab_test(signup_form: "single_page")
164
+ #
165
+ # Force alternatives for multiple experiments:
166
+ # use_ab_test(signup_form: "single_page", pricing: "show_enterprise_prices")
167
+ #
168
+ def use_ab_test(alternatives_by_experiment)
169
+ allow_any_instance_of(Split::Helper).to receive(:ab_test) do |_receiver, experiment|
170
+ alternative =
171
+ alternatives_by_experiment.fetch(experiment) { |key| raise "Unknown experiment '#{key}'" }
172
+ end
173
+ end
174
+ end
175
+
176
+ RSpec.configure do |config|
177
+ # Make the `use_ab_test` method available to all specs:
178
+ config.include SplitHelper
179
+ end
180
+ ```
181
+
182
+
153
183
  ### Starting experiments manually
154
184
 
155
185
  By default new A/B tests will be active right after deployment. In case you would like to start new test a while after
@@ -625,7 +655,7 @@ Once you finish one of the goals, the test is considered to be completed, and fi
625
655
 
626
656
  #### Combined Experiments
627
657
  If you want to test how how button color affects signup *and* how it affects login, at the same time. Use combined tests
628
- Configure like so
658
+ Configure like so
629
659
  ```ruby
630
660
  Split.configuration.experiments = {
631
661
  :button_color_experiment => {
@@ -646,8 +676,8 @@ Finish each combined test as normal
646
676
  ab_finished(:button_color_on_signup)
647
677
  ```
648
678
 
649
- **Additional Configuration**:
650
- * Be sure to enable `allow_multiple_experiments`
679
+ **Additional Configuration**:
680
+ * Be sure to enable `allow_multiple_experiments`
651
681
  * In Sinatra include the CombinedExperimentsHelper
652
682
  ```
653
683
  helpers Split::CombinedExperimentsHelper
@@ -10,7 +10,7 @@ module Split
10
10
  experiment = ExperimentCatalog.find_or_initialize(metric_descriptor, control, *alternatives)
11
11
  alternative = if Split.configuration.enabled
12
12
  experiment.save
13
- raise(Split::InvalidExperimentsFormatError) unless Split::configuration.experiments&.dig(experiment.name.to_sym,:combined_experiments).nil?
13
+ raise(Split::InvalidExperimentsFormatError) unless (Split.configuration.experiments || {}).fetch(experiment.name.to_sym, {})[:combined_experiments].nil?
14
14
  trial = Trial.new(:user => ab_user, :experiment => experiment,
15
15
  :override => override_alternative(experiment.name), :exclude => exclude_visitor?,
16
16
  :disabled => split_generically_disabled?)
@@ -2,6 +2,6 @@
2
2
  module Split
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
@@ -458,7 +458,7 @@ describe Split::Experiment do
458
458
  expect(experiment.alternatives[0].p_winner).to be_within(0.04).of(0.50)
459
459
  end
460
460
 
461
- it "should calculate the probability of being the winning alternative separately for each goal" do
461
+ it "should calculate the probability of being the winning alternative separately for each goal", :skip => true do
462
462
  experiment = Split::ExperimentCatalog.find_or_create({'link_color3' => ["purchase", "refund"]}, 'blue', 'red', 'green')
463
463
  goal1 = experiment.goals[0]
464
464
  goal2 = experiment.goals[1]
@@ -47,7 +47,7 @@ describe Split::Persistence::DualAdapter do
47
47
  context "when logged in" do
48
48
  subject {
49
49
  described_class.with_config(
50
- logged_in: -> (context) { true },
50
+ logged_in: lambda { |context| true },
51
51
  logged_in_adapter: selected_adapter,
52
52
  logged_out_adapter: not_selected_adapter
53
53
  ).new(context)
@@ -59,7 +59,7 @@ describe Split::Persistence::DualAdapter do
59
59
  context "when not logged in" do
60
60
  subject {
61
61
  described_class.with_config(
62
- logged_in: -> (context) { false },
62
+ logged_in: lambda { |context| false },
63
63
  logged_in_adapter: not_selected_adapter,
64
64
  logged_out_adapter: selected_adapter
65
65
  ).new(context)
@@ -21,7 +21,8 @@ Gem::Specification.new do |s|
21
21
  "mailing_list_uri" => "https://groups.google.com/d/forum/split-ruby"
22
22
  }
23
23
 
24
- s.required_ruby_version = '>= 1.9.2'
24
+ s.required_ruby_version = '>= 1.9.3'
25
+ s.required_rubygems_version = '>= 2.0.0'
25
26
 
26
27
  s.rubyforge_project = "split"
27
28
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: split
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -257,15 +257,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
257
257
  requirements:
258
258
  - - ">="
259
259
  - !ruby/object:Gem::Version
260
- version: 1.9.2
260
+ version: 1.9.3
261
261
  required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  requirements:
263
263
  - - ">="
264
264
  - !ruby/object:Gem::Version
265
- version: '0'
265
+ version: 2.0.0
266
266
  requirements: []
267
267
  rubyforge_project: split
268
- rubygems_version: 2.6.4
268
+ rubygems_version: 2.6.11
269
269
  signing_key:
270
270
  specification_version: 4
271
271
  summary: Rack based split testing framework