minitest-bang
Provides the let! method to minitest spec, similar to the RSpec method of the same name.
Install
gem install minitest-bang
or add the following line to Gemfile:
gem 'minitest-bang', require: false
and run bundle install
from your shell.
Then in your test helper, after requiring minitest/autorun:
require 'minitest/bang'
Supported Minitest versions
Currently, minitest-bang supports minitest 4.7.5 through 5.4.0
Usage
You use it just like you would let
, except the ones you define with let!
are automatically invoked right before your before block gets executed:
describe User do
let!(:user1) { create :user }
before do
User.count.must_equal 1
end
it "has one user without referencing user1" do
User.count.must_equal 1
end
end