🕷 software projects

by ryan davis



sitemap

minitest-trump

I've got the best tests in all the land. Absolutely the best!

For when the reality of your tests is just too much to bear, turn your failures into fake news and errors into alt-facts.

  • Turns failures into Fake News.
  • Turns errors into Alt-Facts.
  • May alter your perception of reality, and not for the better.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require "minitest/autorun"
require "minitest/trump"

class TestTrump < Minitest::Test
  def test_failure
    assert_equal 1, 2
  end

  def bad_method
    raise "You're fired!"
  end

  def test_error
    bad_method
  end
end

outputs:

# Running:

FA

Finished in 0.000959s, 2085.5057 runs/s, 1042.7529 assertions/s.

  1) FAKE NEWS!:
TestTrump#test_failure [example.rb:6]:
Expected: 1
  Actual: 2


  2) Alt-Fact:
TestTrump#test_error:
RuntimeError: You're fired!
    example.rb:10:in `bad_method'
    example.rb:14:in `test_error'

2 runs, 1 assertions, 1 failures, 1 errors, 0 skips

Get The Code

If you just want to use minitest-trump, you can install it via RubyGems:
gem install minitest-trump
Fork me on GitHub If you want to hack on minitest-trump, clone it from GitHub:
git clone git://github.com/seattlerb/minitest-trump

Latest Activity