22require '02_evil_mailbox'
33require 'securerandom'
44
5- class TestEvilMailbox < MiniTest ::Test
5+ class TestEvilMailbox < Minitest ::Test
66 def evil_mailbox ( &block )
7- mock = MiniTest ::Mock . new
7+ mock = Minitest ::Mock . new
88 mock . instance_eval ( &block ) if block_given?
99 [ EvilMailbox . new ( mock ) , mock ]
1010 end
@@ -58,15 +58,15 @@ def test_send_mail_exec_block_with_result_false
5858
5959 def test_mail_object_auth
6060 secret_string = SecureRandom . hex
61- mock = MiniTest ::Mock . new
61+ mock = Minitest ::Mock . new
6262 mock . expect :auth , true , [ String ]
6363 EvilMailbox . new ( mock , secret_string )
6464 mock . verify
6565 end
6666
6767 def test_send_mail_with_secret_string
6868 secret_string = SecureRandom . hex
69- mock = MiniTest ::Mock . new
69+ mock = Minitest ::Mock . new
7070 mock . expect :auth , true , [ String ]
7171 mock . expect :send_mail , true , [ "ppyd" , "hello#{ secret_string } " ]
7272 mb = EvilMailbox . new ( mock , secret_string )
@@ -77,7 +77,7 @@ def test_send_mail_with_secret_string
7777
7878 def test_no_secret_string_in_object
7979 secret_string = SecureRandom . hex
80- mock = MiniTest ::Mock . new
80+ mock = Minitest ::Mock . new
8181 mock . expect :auth , true , [ String ]
8282 mb = EvilMailbox . new ( mock , secret_string )
8383
@@ -91,7 +91,7 @@ def test_no_secret_string_in_object
9191 end
9292
9393 def evil_mailbox_with_secret_string ( secret_string , &block )
94- mock = MiniTest ::Mock . new
94+ mock = Minitest ::Mock . new
9595 mock . instance_eval ( &block ) if block_given?
9696 [ EvilMailbox . new ( mock , secret_string ) , mock ]
9797 end
0 commit comments