Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Oct 27, 2023
1 parent fd4c816 commit 35bf797
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,46 @@ Usage
```Ruby
require "maxitest/autorun"

... normal tests ...
# ... normal minitest tests ...
describe MyClass do
describe "#my_method" do
it "passes" do
_(MyClass.new.my_method).must_equal 1
end
end
end
```

### pending

- `pending "need to fix" do` to show why something is pending
- `pending "need to fix", if: ENV["CI"] do` to only skip on CI (if something is supposed to work locally)

### with_env

Use during test: `with_env FOO: "bar do ...`
Use as `around` block: `with_env FOO: "bar"`

### context

Use as alias for `describe`

```ruby
describe "#my_method" do
context "with bad state" do
before { errors += 1 }
it "fails" # ...
end
end
```

### capture_stdout / capture_stderr

```ruby
output = capture_stdout { puts 1 }
_(output).must_equal "1\n"
```

Development
===========
- everything vendored into 1 gem to avoid dependency madness
Expand Down

0 comments on commit 35bf797

Please sign in to comment.