diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-29 11:27:32 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-29 11:27:32 +0000 |
commit | 96d576733aea018eb0415d0b777496ee0d5a8578 (patch) | |
tree | 0b2def7a8a8c2288b9cd3b9c5fcae77c0fe36dae /test/irb | |
parent | 87bebfb9fa7c91aaac9458f5dc09f424234a1b85 (diff) | |
download | ruby-96d576733aea018eb0415d0b777496ee0d5a8578.tar.gz |
test_workspace.rb: prefer using skip
rather than ignoring test definition to know untestability when
executing test with `-v`.
Also this simplifies check using `MiniTest::Unit::Guard#windows?`.
This change is suggested by @MSP-Greg here:
https://github.com/ruby/ruby/commit/7128849c8c5fce8df450379db54136fd21fab6ad#commitcomment-25836745
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/irb')
-rw-r--r-- | test/irb/test_workspace.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb index d67b9f6713..0dd46175c8 100644 --- a/test/irb/test_workspace.rb +++ b/test/irb/test_workspace.rb @@ -32,18 +32,18 @@ module TestIRB end end - unless /mswin|mingw/ =~ RUBY_PLATFORM - def test_code_around_binding_with_existing_unreadable_file - Tempfile.create do |f| - code = "IRB::WorkSpace.new(binding)\n" - f.print(code) - f.close + def test_code_around_binding_with_existing_unreadable_file + skip 'chmod cannot make file unreadable on windows' if windows? - File.chmod(0, f.path) + Tempfile.create do |f| + code = "IRB::WorkSpace.new(binding)\n" + f.print(code) + f.close - workspace = eval(code, binding, f.path) - assert_equal(nil, workspace.code_around_binding) - end + File.chmod(0, f.path) + + workspace = eval(code, binding, f.path) + assert_equal(nil, workspace.code_around_binding) end end |