Package: rubygems / 1.8.24-1

20120608-fix-test_gem_platform.rb.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Index: rubygems/test/rubygems/test_gem_platform.rb
===================================================================
--- rubygems.orig/test/rubygems/test_gem_platform.rb	2012-06-09 20:13:11.000000000 +0900
+++ rubygems/test/rubygems/test_gem_platform.rb	2012-06-09 20:24:48.000000000 +0900
@@ -207,64 +207,71 @@
   def test_equals_tilde
     util_set_arch 'i386-mswin32'
 
-    assert_match 'mswin32',      Gem::Platform.local
-    assert_match 'i386-mswin32', Gem::Platform.local
+    assert_local_match 'mswin32'
+    assert_local_match 'i386-mswin32'
 
     # oddballs
-    assert_match 'i386-mswin32-mq5.3', Gem::Platform.local
-    assert_match 'i386-mswin32-mq6',   Gem::Platform.local
-    refute_match 'win32-1.8.2-VC7',    Gem::Platform.local
-    refute_match 'win32-1.8.4-VC6',    Gem::Platform.local
-    refute_match 'win32-source',       Gem::Platform.local
-    refute_match 'windows',            Gem::Platform.local
+    assert_local_match 'i386-mswin32-mq5.3'
+    assert_local_match 'i386-mswin32-mq6'
+    refute_local_match 'win32-1.8.2-VC7'
+    refute_local_match 'win32-1.8.4-VC6'
+    refute_local_match 'win32-source'
+    refute_local_match 'windows'
 
     util_set_arch 'i686-linux'
-    assert_match 'i486-linux', Gem::Platform.local
-    assert_match 'i586-linux', Gem::Platform.local
-    assert_match 'i686-linux', Gem::Platform.local
+    assert_local_match 'i486-linux'
+    assert_local_match 'i586-linux'
+    assert_local_match 'i686-linux'
 
     util_set_arch 'i686-darwin8'
-    assert_match 'i686-darwin8.4.1', Gem::Platform.local
-    assert_match 'i686-darwin8.8.2', Gem::Platform.local
+    assert_local_match 'i686-darwin8.4.1'
+    assert_local_match 'i686-darwin8.8.2'
 
     util_set_arch 'java'
-    assert_match 'java',  Gem::Platform.local
-    assert_match 'jruby', Gem::Platform.local
+    assert_local_match 'java'
+    assert_local_match 'jruby'
 
     util_set_arch 'universal-dotnet2.0'
-    assert_match 'universal-dotnet',     Gem::Platform.local
-    assert_match 'universal-dotnet-2.0', Gem::Platform.local
-    refute_match 'universal-dotnet-4.0', Gem::Platform.local
-    assert_match 'dotnet',               Gem::Platform.local
-    assert_match 'dotnet-2.0',           Gem::Platform.local
-    refute_match 'dotnet-4.0',           Gem::Platform.local
+    assert_local_match 'universal-dotnet'
+    assert_local_match 'universal-dotnet-2.0'
+    refute_local_match 'universal-dotnet-4.0'
+    assert_local_match 'dotnet'
+    assert_local_match 'dotnet-2.0'
+    refute_local_match 'dotnet-4.0'
 
     util_set_arch 'universal-dotnet4.0'
-    assert_match 'universal-dotnet',      Gem::Platform.local
-    refute_match 'universal-dotnet-2.0',  Gem::Platform.local
-    assert_match 'universal-dotnet-4.0',  Gem::Platform.local
-    assert_match 'dotnet',                Gem::Platform.local
-    refute_match 'dotnet-2.0',            Gem::Platform.local
-    assert_match 'dotnet-4.0',            Gem::Platform.local
+    assert_local_match 'universal-dotnet'
+    refute_local_match 'universal-dotnet-2.0'
+    assert_local_match 'universal-dotnet-4.0'
+    assert_local_match 'dotnet'
+    refute_local_match 'dotnet-2.0'
+    assert_local_match 'dotnet-4.0'
 
     util_set_arch 'universal-macruby-1.0'
-    assert_match 'universal-macruby',      Gem::Platform.local
-    assert_match 'macruby',                Gem::Platform.local
-    refute_match 'universal-macruby-0.10', Gem::Platform.local
-    assert_match 'universal-macruby-1.0',  Gem::Platform.local
+    assert_local_match 'universal-macruby'
+    assert_local_match 'macruby'
+    refute_local_match 'universal-macruby-0.10'
+    assert_local_match 'universal-macruby-1.0'
 
     util_set_arch 'powerpc-darwin'
-    assert_match 'powerpc-darwin', Gem::Platform.local
+    assert_local_match 'powerpc-darwin'
 
     util_set_arch 'powerpc-darwin7'
-    assert_match 'powerpc-darwin7.9.0', Gem::Platform.local
+    assert_local_match 'powerpc-darwin7.9.0'
 
     util_set_arch 'powerpc-darwin8'
-    assert_match 'powerpc-darwin8.10.0', Gem::Platform.local
+    assert_local_match 'powerpc-darwin8.10.0'
 
     util_set_arch 'sparc-solaris2.8'
-    assert_match 'sparc-solaris2.8-mq5.3', Gem::Platform.local
+    assert_local_match 'sparc-solaris2.8-mq5.3'
   end
 
+  def assert_local_match name
+    assert_match Gem::Platform.local, name
+  end
+
+  def refute_local_match name
+    refute_match Gem::Platform.local, name
+  end
 end