Skip to content
This repository
Browse code

Small spec fixes for Ruby 1.9.3

  • Loading branch information...
commit eb295c106da8ff122e6efe71c21accb8eb692c37 1 parent fcdc3b6
Michael Dvorkin authored September 03, 2012
17  spec/methods_spec.rb
@@ -155,9 +155,10 @@ class Hello
155 155
         def m1; end
156 156
         def m2; end
157 157
       end
  158
+
158 159
       out = Hello.new.private_methods.ai(:plain => true).split("\n").grep(/m\d/)
159  
-      out.first.should =~ /^\s+\[\d+\]\s+m1\(\)\s+Hello$/
160  
-      out.last.should  =~ /^\s+\[\d+\]\s+m2\(\)\s+Hello$/
  160
+      out.first.should =~ /^\s+\[\s*\d+\]\s+m1\(\)\s+Hello$/
  161
+      out.last.should  =~ /^\s+\[\s*\d+\]\s+m2\(\)\s+Hello$/
161 162
     end
162 163
 
163 164
     it "no index: should handle object.private_methods" do
@@ -167,9 +168,9 @@ def m3(a,b); end
167 168
       end
168 169
       out = Hello.new.private_methods.ai(:plain => true).split("\n").grep(/m\d/)
169 170
       if RUBY_VERSION < '1.9.2'
170  
-        out.first.should =~ /^\s+\[\d+\]\s+m3\(arg1, arg2\)\s+Hello$/
  171
+        out.first.should =~ /^\s+\[\s*\d+\]\s+m3\(arg1, arg2\)\s+Hello$/
171 172
       else
172  
-        out.first.should =~ /^\s+\[\d+\]\s+m3\(a, b\)\s+Hello$/
  173
+        out.first.should =~ /^\s+\[\s*\d+\]\s+m3\(a, b\)\s+Hello$/
173 174
       end
174 175
     end
175 176
   end
@@ -183,8 +184,8 @@ def m2; end
183 184
         end
184 185
       end
185 186
       out = Hello.singleton_methods.ai(:plain => true).split("\n").grep(/m\d/)
186  
-      out.first.should =~ /^\s+\[\d+\]\s+m1\(\)\s+Hello$/
187  
-      out.last.should  =~ /^\s+\[\d+\]\s+m2\(\)\s+Hello$/
  187
+      out.first.should =~ /^\s+\[\s*\d+\]\s+m1\(\)\s+Hello$/
  188
+      out.last.should  =~ /^\s+\[\s*\d+\]\s+m2\(\)\s+Hello$/
188 189
     end
189 190
 
190 191
     it "no index: should handle object.singleton_methods" do
@@ -266,8 +267,8 @@ def m1; end
266 267
         def m2; end
267 268
       end
268 269
       out = Hello.protected_instance_methods.ai(:plain => true).split("\n").grep(/m\d/)
269  
-      out.first.should =~ /^\s+\[\d+\]\s+m1\(\)\s+Hello\s\(unbound\)$/
270  
-      out.last.should  =~ /^\s+\[\d+\]\s+m2\(\)\s+Hello\s\(unbound\)$/
  270
+      out.first.should =~ /^\s+\[\s*\d+\]\s+m1\(\)\s+Hello\s\(unbound\)$/
  271
+      out.last.should  =~ /^\s+\[\s*\d+\]\s+m2\(\)\s+Hello\s\(unbound\)$/
271 272
     end
272 273
 
273 274
     it "no index: should handle class.protected_instance_methods" do
6  spec/spec_helper.rb
@@ -8,6 +8,12 @@
8 8
 #   $ rake spec                   # Entire spec suite.
9 9
 #   $ rspec spec/objects_spec.rb  # Individual spec file.
10 10
 #
  11
+# NOTE: To successfully run specs with Ruby 1.8.6 the older versions of
  12
+# Bundler and RSpec gems are required:
  13
+#
  14
+# $ gem install bundler -v=1.0.2
  15
+# $ gem install rspec -v=2.6.0
  16
+#
11 17
 $LOAD_PATH.unshift(File.dirname(__FILE__))
12 18
 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
13 19
 require 'awesome_print'

0 notes on commit eb295c1

Please sign in to comment.
Something went wrong with that request. Please try again.