###前提・実現したいこと
題名の通りなのですが、MiniTest::Specでrspecのbefore(:all)のように
振る舞いに対して1回だけ処理するように書きたいです。
ruby
1 describe 'xxx' do 2 before do 3 p 'before' 4 end 5 6 it 'test1' do 7 p 'test1' 8 end 9 10 it 'test2' do 11 p 'test2' 12 end
とすると、
before
test1
before
test2
と出力されますが、
before
test1
test2
と出力させる方法はあるでしょうか。
あなたの回答
tips
プレビュー