Skip to content

Commit 4a45412

Browse files
committed
Only explain new version in the README
1 parent b2311bc commit 4a45412

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

README.md

+1-19
Original file line numberDiff line numberDiff line change
@@ -550,25 +550,7 @@ end
550550

551551
#### Providing fake timing data
552552

553-
If you're writing tests that depend on specific timing values, you can provide canned durations using the `fabricate_durations_for_testing_purposes` method. This can be done using either the old version (single value) or the new version (hash-based) to include both duration and cpu_time.
554-
555-
##### Old version (Single Value)
556-
557-
In the old version, you can provide a single value for the duration:
558-
559-
```ruby
560-
science "absolutely-nothing-suspicious-happening-here" do |e|
561-
e.use { ... } # "control"
562-
e.try { ... } # "candidate"
563-
e.fabricate_durations_for_testing_purposes( "control" => 1.0, "candidate" => 0.5 )
564-
end
565-
```
566-
567-
`fabricate_durations_for_testing_purposes` takes a Hash of duration values, keyed by behavior names. (By default, Scientist uses `"control"` and `"candidate"`, but if you override these as shown in [Trying more than one thing](#trying-more-than-one-thing) or [No control, just candidates](#no-control-just-candidates), use matching names here.) If a name is not provided, the actual execution time will be reported instead.
568-
569-
##### New version (Hash-based)
570-
571-
Scientist will report these in `Scientist::Observation#duration` and `Scientist::Observation#cpu_time` instead of the actual execution times.
553+
If you're writing tests that depend on specific timing values, you can provide canned durations using the `fabricate_durations_for_testing_purposes` method, and Scientist will report these in `Scientist::Observation#duration` and `Scientist::Observation#cpu_time` instead of the actual execution times.
572554

573555
```ruby
574556
science "absolutely-nothing-suspicious-happening-here" do |e|

0 commit comments

Comments
 (0)