Skip to content

Commit fdce242

Browse files
nagachikako1
authored andcommitted
omit some tests without proper permission to HOME directory.
1 parent ebb3750 commit fdce242

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

test/console/backtrace_test.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ def test_frame_filtering_works_with_unexpanded_path_and_expanded_skip_path
122122
2| Foo.new.bar
123123
RUBY
124124

125+
if File.writable?(pty_home_dir)
126+
omit "Skip test with load files. Cannot create files in HOME directory."
127+
end
128+
125129
debug_code(program) do
126130
type "file = File.open('#{pty_home_dir}/foo.rb', 'w+') { |f| f.write('#{foo_file}') }"
127131
type 'c'
@@ -135,7 +139,9 @@ def test_frame_filtering_works_with_unexpanded_path_and_expanded_skip_path
135139
type 'c'
136140
end
137141
ensure
138-
File.unlink "#{pty_home_dir}/foo.rb"
142+
if File.exist? "#{pty_home_dir}/foo.rb"
143+
File.unlink "#{pty_home_dir}/foo.rb"
144+
end
139145
end
140146
end
141147

test/console/rdbg_option_test.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,17 @@ def program
9797
end
9898

9999
def with_rc_script
100-
File.open(rc_filename, "w") { |f| f.write(rc_script) }
100+
begin
101+
File.open(rc_filename, "w") { |f| f.write(rc_script) }
102+
rescue Errno::EPERM
103+
omit "Skip test with rc files. Cannot create rcfiles in HOME directory."
104+
end
101105

102106
yield
103107
ensure
104-
File.delete(rc_filename)
108+
if File.exist?(rc_filename)
109+
File.delete(rc_filename)
110+
end
105111
end
106112

107113
def test_debugger_loads_the_rc_file_by_default

0 commit comments

Comments
 (0)