vinted-ab 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ab.gemspec +3 -3
- data/lib/ab/experiment.rb +1 -1
- data/lib/ab/version.rb +1 -1
- data/spec/experiment_spec.rb +39 -0
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a21ffb413b2b0c68b513cc983fae9e5073f0a1b
|
4
|
+
data.tar.gz: 7508566e6b56ff075d45180d7da2dc3aa84b4566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f4f9ae4e40487dcbfebe92e1828711c0b40ebde3711141fe477623e421cda679400365e7a6855d02742479290905fd9c7d682766525af4dafc6bd2035ecf628
|
7
|
+
data.tar.gz: 5691f5a0724ce36648a7029d7c095a4034c50c8e675e747ef44b69083b149e68342a3597494d07fb7d79c57296235f2ec9c30655b9491663e740d0742f9b7aba
|
data/ab.gemspec
CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.
|
22
|
+
spec.add_runtime_dependency 'hooks', '~> 0.4', '>= 0.4.0'
|
23
23
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
24
|
-
spec.add_development_dependency 'rake', '~> 10.1.0'
|
25
|
-
spec.add_development_dependency 'rspec', '~> 2.14.0'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.1', '>= 10.1.0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.0'
|
26
26
|
end
|
data/lib/ab/experiment.rb
CHANGED
data/lib/ab/version.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Ab
|
4
|
+
describe Experiment do
|
5
|
+
let(:experiment) { Experiment.new(experiment_hash, '4321', 100) }
|
6
|
+
|
7
|
+
context '#buckets' do
|
8
|
+
subject { experiment.buckets }
|
9
|
+
let(:experiment_hash) { { 'buckets' => [1, 2, 3] } }
|
10
|
+
it { should == [1, 2, 3] }
|
11
|
+
end
|
12
|
+
|
13
|
+
context '#name' do
|
14
|
+
subject { experiment.name }
|
15
|
+
let(:experiment_hash) { { 'name' => 'test' } }
|
16
|
+
it { should == 'test' }
|
17
|
+
end
|
18
|
+
|
19
|
+
context '#start_at' do
|
20
|
+
subject { experiment.start_at }
|
21
|
+
let(:experiment_hash) { { 'start_at' => '2014-05-27T11:56:25+03:00' } }
|
22
|
+
it { should == DateTime.new(2014, 5, 27, 11, 56, 25, '+3') }
|
23
|
+
end
|
24
|
+
|
25
|
+
context '#end_at' do
|
26
|
+
subject { experiment.end_at }
|
27
|
+
|
28
|
+
context 'nil' do
|
29
|
+
let(:experiment_hash) { {} }
|
30
|
+
it { should > DateTime.new(2020) }
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'april fools' do
|
34
|
+
let(:experiment_hash) { { 'end_at' => '2014-04-01T12:00:00+00:00' } }
|
35
|
+
it { should == DateTime.new(2014, 4, 1, 12) }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vinted-ab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
@@ -9,13 +9,16 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hooks
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0.4'
|
21
|
+
- - '>='
|
19
22
|
- !ruby/object:Gem::Version
|
20
23
|
version: 0.4.0
|
21
24
|
type: :runtime
|
@@ -23,6 +26,9 @@ dependencies:
|
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
28
|
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.4'
|
31
|
+
- - '>='
|
26
32
|
- !ruby/object:Gem::Version
|
27
33
|
version: 0.4.0
|
28
34
|
- !ruby/object:Gem::Dependency
|
@@ -44,6 +50,9 @@ dependencies:
|
|
44
50
|
requirement: !ruby/object:Gem::Requirement
|
45
51
|
requirements:
|
46
52
|
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.1'
|
55
|
+
- - '>='
|
47
56
|
- !ruby/object:Gem::Version
|
48
57
|
version: 10.1.0
|
49
58
|
type: :development
|
@@ -51,6 +60,9 @@ dependencies:
|
|
51
60
|
version_requirements: !ruby/object:Gem::Requirement
|
52
61
|
requirements:
|
53
62
|
- - ~>
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '10.1'
|
65
|
+
- - '>='
|
54
66
|
- !ruby/object:Gem::Version
|
55
67
|
version: 10.1.0
|
56
68
|
- !ruby/object:Gem::Dependency
|
@@ -58,6 +70,9 @@ dependencies:
|
|
58
70
|
requirement: !ruby/object:Gem::Requirement
|
59
71
|
requirements:
|
60
72
|
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '2.14'
|
75
|
+
- - '>='
|
61
76
|
- !ruby/object:Gem::Version
|
62
77
|
version: 2.14.0
|
63
78
|
type: :development
|
@@ -65,6 +80,9 @@ dependencies:
|
|
65
80
|
version_requirements: !ruby/object:Gem::Requirement
|
66
81
|
requirements:
|
67
82
|
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '2.14'
|
85
|
+
- - '>='
|
68
86
|
- !ruby/object:Gem::Version
|
69
87
|
version: 2.14.0
|
70
88
|
description:
|
@@ -89,6 +107,7 @@ files:
|
|
89
107
|
- lib/ab/variant.rb
|
90
108
|
- lib/ab/version.rb
|
91
109
|
- spec/assigned_experiment_spec.rb
|
110
|
+
- spec/experiment_spec.rb
|
92
111
|
- spec/experiments_spec.rb
|
93
112
|
- spec/null_experiment_spec.rb
|
94
113
|
- spec/spec_helper.rb
|