Created
January 1, 2020 04:39
-
-
Save minghz/572ea510a514c0f0bcecd4f30307f18b to your computer and use it in GitHub Desktop.
Revisions
-
minghz created this gist
Jan 1, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # you actually need the "minitest-hooks" gem to get this lib =_=" require 'minitest/hooks' require 'minitest/autorun' class ExtendedMinitest < Minitest::Test extend MiniTest::Spec::DSL include Minitest::Hooks # You need to add this to your test classes end class MyTest < ExtendedMinitest before(:all) do Heavy = Struct.new(:something, :takes, :of, :to) @heavy_variable = Heavy.new('that', 'a lot', 'time', 'setup') puts 'gets printed once only' end it { assert_equal 'that', @heavy_variable.something } it { assert_equal 'a lot', @heavy_variable.takes } it { assert_equal 'time', @heavy_variable.of } it { assert_equal 'setup', @heavy_variable.to } end