Skip to content

Commit cc78c2b

Browse files
st0012ko1
authored andcommitted
Remove extra file helper
1 parent e19728e commit cc78c2b

File tree

4 files changed

+11
-24
lines changed

4 files changed

+11
-24
lines changed

test/debug/break_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ def test_debugger_doesnt_stop_when_other_instance_calls_the_inherited_method
205205
end
206206

207207
class PathOptionTest < TestCase
208-
include ExtraFileHelper
209-
210208
def extra_file
211209
<<~RUBY
212210
Foo.new.bar
@@ -310,8 +308,6 @@ def test_break_C_method_with_singleton_method
310308
end
311309

312310
class PathOptionTest < TestCase
313-
include ExtraFileHelper
314-
315311
def extra_file
316312
<<~RUBY
317313
1.abs
@@ -618,8 +614,6 @@ def test_conditional_breakpoint_shows_error
618614
end
619615

620616
class PathOptionTest < TestCase
621-
include ExtraFileHelper
622-
623617
def extra_file
624618
<<~RUBY
625619
a = 100

test/debug/catch_test.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ def test_catch_with_namespace_stops_at_exception
150150
end
151151

152152
class PathOptionTest < TestCase
153-
include ExtraFileHelper
154-
155153
def extra_file
156154
<<~RUBY
157155
def bar

test/support/extra_file_helper.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/support/test_case.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
require 'test/unit'
44
require 'tempfile'
5+
require 'securerandom'
56

67
require_relative 'utils'
78
require_relative 'assertions'
8-
require_relative 'extra_file_helper'
99

1010
module DEBUGGER__
1111
class TestCase < Test::Unit::TestCase
@@ -24,5 +24,15 @@ def remove_temp_file
2424
File.unlink(@temp_file) if @temp_file
2525
@temp_file = nil
2626
end
27+
28+
def with_extra_tempfile
29+
t = Tempfile.create([SecureRandom.hex(5), '.rb']).tap do |f|
30+
f.write(extra_file)
31+
f.close
32+
end
33+
yield t
34+
ensure
35+
File.unlink t if t
36+
end
2737
end
2838
end

0 commit comments

Comments
 (0)