scientist 1.5.0 → 1.6.0
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 +4 -4
- data/.travis.yml +1 -0
- data/README.md +4 -1
- data/lib/scientist/experiment.rb +1 -1
- data/lib/scientist/version.rb +1 -1
- data/test/scientist/experiment_test.rb +19 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f03841ae9bccb8d7b979971d5f6a38482f57bbc81af82d0a710479ccc3f16fbb
|
4
|
+
data.tar.gz: c0f81d696918e302462baf1bd918cd25179a99045d48082fb162e1fdb2fa2280
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1680e6564a6e83b3dde55f6757f3e7c953a70b3d748aa0e7ca2a54b5a33a4b3a947a8f20aa52790a41e6a66e36627e4e851f627625c0aaf9fd4cf41b94ace8c
|
7
|
+
data.tar.gz: 75ba381053b73e9418ed2ab5608c70c92a55990c938a1c25f4324169ff560a8feea6827ef909e50b9fc3baf5a5eb49f3b7b26ed4e3f9799007b80a71c7543c86
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,7 @@ Wrap a `use` block around the code's original behavior, and wrap `try` around th
|
|
24
24
|
|
25
25
|
* It decides whether or not to run the `try` block,
|
26
26
|
* Randomizes the order in which `use` and `try` blocks are run,
|
27
|
-
* Measures the durations of all behaviors,
|
27
|
+
* Measures the durations of all behaviors in seconds,
|
28
28
|
* Compares the result of `try` to the result of `use`,
|
29
29
|
* Swallow and record exceptions raised in the `try` block when overriding `raised`, and
|
30
30
|
* Publishes all this information.
|
@@ -84,6 +84,8 @@ class MyExperiment
|
|
84
84
|
end
|
85
85
|
```
|
86
86
|
|
87
|
+
When `Scientist::Experiment` is included in a class, it automatically sets it as the default implementation via `Scientist::Experiment.set_default`. This `set_default` call is is skipped if you include `Scientist::Experiment` in a module.
|
88
|
+
|
87
89
|
Now calls to the `science` helper will load instances of `MyExperiment`.
|
88
90
|
|
89
91
|
### Controlling comparison
|
@@ -548,6 +550,7 @@ Be on a Unixy box. Make sure a modern Bundler is available. `script/test` runs t
|
|
548
550
|
- [spoptchev/scientist](https://github.com/spoptchev/scientist) (Kotlin / Java)
|
549
551
|
- [junkpiano/scientist](https://github.com/junkpiano/scientist) (Swift)
|
550
552
|
- [serverless scientist](http://serverlessscientist.com/) (AWS Lambda)
|
553
|
+
- [fightmegg/scientist](https://github.com/fightmegg/scientist) (TypeScript, Browser / Node.js)
|
551
554
|
|
552
555
|
## Maintainers
|
553
556
|
|
data/lib/scientist/experiment.rb
CHANGED
data/lib/scientist/version.rb
CHANGED
@@ -31,6 +31,24 @@ describe Scientist::Experiment do
|
|
31
31
|
@ex = Fake.new
|
32
32
|
end
|
33
33
|
|
34
|
+
it "sets the default on inclusion" do
|
35
|
+
klass = Class.new do
|
36
|
+
include Scientist::Experiment
|
37
|
+
|
38
|
+
def initialize(name)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
assert_kind_of klass, Scientist::Experiment.new("hello")
|
43
|
+
|
44
|
+
Scientist::Experiment.set_default(nil)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "doesn't set the default on inclusion when it's a module" do
|
48
|
+
Module.new { include Scientist::Experiment }
|
49
|
+
assert_kind_of Scientist::Default, Scientist::Experiment.new("hello")
|
50
|
+
end
|
51
|
+
|
34
52
|
it "has a default implementation" do
|
35
53
|
ex = Scientist::Experiment.new("hello")
|
36
54
|
assert_kind_of Scientist::Default, ex
|
@@ -549,7 +567,7 @@ candidate:
|
|
549
567
|
assert_equal " \"value\"", lines[2]
|
550
568
|
assert_equal "candidate:", lines[3]
|
551
569
|
assert_equal " #<RuntimeError: error>", lines[4]
|
552
|
-
assert_match %r(
|
570
|
+
assert_match %r(test/scientist/experiment_test.rb:\d+:in `block), lines[5]
|
553
571
|
end
|
554
572
|
end
|
555
573
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scientist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2021-03-08 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: minitest
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
|
-
rubygems_version: 3.1.
|
98
|
+
rubygems_version: 3.1.4
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Carefully test, measure, and track refactored code.
|