Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix README example #210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,9 @@ When the experiment runs, all candidate behaviors are tested and each candidate
Define the candidates with named `try` blocks, omit a `use`, and pass a candidate name to `run`:

```ruby
experiment = MyExperiment.new("various-ways") do |e|
e.try("first-way") { ... }
e.try("second-way") { ... }
end
experiment = MyExperiment.new("various-ways")
experiment.try("first-way") { ... }
experiment.try("second-way") { ... }
Comment on lines +514 to +516

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there's a tap missing?

Suggested change
experiment = MyExperiment.new("various-ways")
experiment.try("first-way") { ... }
experiment.try("second-way") { ... }
experiment = MyExperiment.new("various-ways").tap do |e|
e.try("first-way") { ... }
e.try("second-way") { ... }
end


experiment.run("second-way")
```
Expand Down