-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,56 @@ | ||
--- | ||
title: Install Minitest | ||
weight: 3 | ||
weight: 4 | ||
--- | ||
|
||
# Install Minitest | ||
|
||
For this book we're going to use [Minitest](https://github.com/minitest/minitest), | ||
this testing tool was added to Ruby’s standard library. | ||
|
||
## How to install Minitest | ||
|
||
```sh | ||
# Gemfile | ||
source "https://rubygems.org" | ||
|
||
gem "minitest" | ||
``` | ||
|
||
```sh | ||
bundle install | ||
``` | ||
|
||
## Validate Minitest is installed | ||
|
||
Once you have Minitest installed you need to create | ||
a new file called `test_foo.rb` with the following code | ||
(*right now don't care about it!*): | ||
|
||
```ruby | ||
require "minitest/autorun" | ||
|
||
class TestFoo < Minitest::Test | ||
def test_foo | ||
assert_equal 1, 1 | ||
end | ||
end | ||
``` | ||
Save the file and run the following command in the terminal: | ||
|
||
```sh | ||
ruby test_foo.rb | ||
``` | ||
|
||
You should see something like these results: | ||
|
||
```sh | ||
Run options: --seed 6109 | ||
|
||
# Running: | ||
|
||
. | ||
|
||
Finished in 0.000829s, 1206.0617 runs/s, 1206.0617 assertions/s. | ||
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: Prepare the project | ||
weight: 3 | ||
--- | ||
|
||
# Prepare the project for this book | ||
|
||
## Create the folder for the chapters and its tests | ||
|
||
```sh | ||
mkdir tests src | ||
``` | ||
|
||
## Create a new Ruby project | ||
|
||
```sh | ||
bundle init | ||
``` | ||
|
||
```sh | ||
# Gemfile | ||
source "https://rubygems.org" | ||
``` |