[前][次][番号順一覧][スレッド一覧]

ruby-changes:48820

From: k0kubun <ko1@a...>
Date: Wed, 29 Nov 2017 20:27:38 +0900 (JST)
Subject: [ruby-changes:48820] k0kubun:r60937 (trunk): test_workspace.rb: prefer using skip

k0kubun	2017-11-29 20:27:32 +0900 (Wed, 29 Nov 2017)

  New Revision: 60937

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60937

  Log:
    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

  Modified files:
    trunk/test/irb/test_workspace.rb
Index: test/irb/test_workspace.rb
===================================================================
--- test/irb/test_workspace.rb	(revision 60936)
+++ test/irb/test_workspace.rb	(revision 60937)
@@ -32,18 +32,18 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_workspace.rb#L32
       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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]