Provides the let! method to minitest spec, similar to the RSpec method of the same name.
Ruby Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gemfiles
lib/minitest
test
.coveralls.yml
.gitignore
.travis.yml
Gemfile
Gemfile.lock
README.md
Rakefile
minitest-bang.gemspec

README.md

minitest-bang

Build Status Code Climate Coverage Status

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