public
Description: RSpec-syntax compatible framework for RubySpecs
Homepage: http://rubyspec.org
Clone URL: git://github.com/brixen/mspec.git
Fixed ruby_bug guard to use Integers internally.
Brian Ford (author)
Fri May 23 22:04:13 -0700 2008
commit  4218fed7333151c4fd737056aee4175a5cd1638a
tree    76724ed61d0b7ec64e97bcf072270d010ac9ba01
parent  f54c60ac9c4ac2c62b3d807d7b5f31666a7414f4
...
10
11
12
13
 
14
15
16
...
10
11
12
 
13
14
15
16
0
@@ -10,7 +10,7 @@ class BugGuard < VersionGuard
0
     major, minor, tiny, patch = str.split "."
0
     tiny = 99 unless tiny
0
     patch = 9999 unless patch
0
-    "%02d%02d%02d%04d" % [major, minor, tiny, patch].map { |x| x.to_i }
0
+    ("1%02d%02d%02d%04d" % [major, minor, tiny, patch].map { |x| x.to_i }).to_i
0
   end
0
 
0
   def match?
...
7
8
9
10
 
11
12
13
14
15
16
 
 
 
17
18
19
...
7
8
9
 
10
11
12
13
 
 
 
14
15
16
17
18
19
0
@@ -7,13 +7,13 @@ describe BugGuard, "#to_v" do
0
   end
0
 
0
   it "returns a version string containing only digits" do
0
-    @guard.to_v("1.8.6.22").should == "0108060022"
0
+    @guard.to_v("1.8.6.22").should == 10108060022
0
   end
0
 
0
   it "replaces missing version parts with zeros" do
0
-    @guard.to_v("1.8").should == "0108999999"
0
-    @guard.to_v("1.8.6").should == "0108069999"
0
-    @guard.to_v("1.8.7.333").should == "0108070333"
0
+    @guard.to_v("1.8").should == 10108999999
0
+    @guard.to_v("1.8.6").should == 10108069999
0
+    @guard.to_v("1.8.7.333").should == 10108070333
0
   end
0
 end
0
 

Comments