0.02
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Lets you use let! to immediately execute lets in minitest spec.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7
~> 10

Runtime

>= 4.7.5
 Project Readme

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