[macruby-changes] [2093] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Sun Jul 26 21:19:13 PDT 2009


Revision: 2093
          http://trac.macosforge.org/projects/ruby/changeset/2093
Author:   mattaimonetti at gmail.com
Date:     2009-07-26 21:19:12 -0700 (Sun, 26 Jul 2009)
Log Message:
-----------
re added the warnings now that they got added to MacRuby

Modified Paths:
--------------
    MacRuby/branches/experimental/lib/strscan.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb

Modified: MacRuby/branches/experimental/lib/strscan.rb
===================================================================
--- MacRuby/branches/experimental/lib/strscan.rb	2009-07-27 03:49:59 UTC (rev 2092)
+++ MacRuby/branches/experimental/lib/strscan.rb	2009-07-27 04:19:12 UTC (rev 2093)
@@ -165,7 +165,7 @@
   # This method is obsolete; use #terminate instead.
   #
   def clear
-    # warn "StringScanner#clear is obsolete; use #terminate instead" if $VERBOSE
+    warn "StringScanner#clear is obsolete; use #terminate instead" if $VERBOSE
     terminate
   end
   
@@ -231,7 +231,7 @@
   # This method is obsolete; use #get_byte instead.
   #
   def getbyte
-    # warn "StringScanner#getbyte is obsolete; use #get_byte instead" if $VERBOSE
+    warn "StringScanner#getbyte is obsolete; use #get_byte instead" if $VERBOSE
     get_byte
   end
   
@@ -318,7 +318,7 @@
   # This method is obsolete, use #eos? instead.
   #
   def empty?
-    # warn "StringScanner#empty? is obsolete; use #eos? instead" if $VERBOSE
+    warn "StringScanner#empty? is obsolete; use #eos? instead" if $VERBOSE
     eos?
   end
   
@@ -350,7 +350,7 @@
   # This method is obsolete; use #rest_size instead.
   #
   def restsize
-    # warn "StringScanner#restsize is obsolete; use #rest_size instead" if $VERBOSE
+    warn "StringScanner#restsize is obsolete; use #rest_size instead" if $VERBOSE
     rest_size
   end
   
@@ -430,7 +430,7 @@
   # This method is obsolete; use #matched_size instead.
   #
   def matchedsize
-    # warn "StringScanner#matchedsize is obsolete; use #matched_size instead" if $VERBOSE
+    warn "StringScanner#matchedsize is obsolete; use #matched_size instead" if $VERBOSE
     matched_size
   end
  
@@ -530,7 +530,7 @@
   # This method is obsolete; use #peek instead.
   #
   def peep(length)
-    # warn "StringScanner#peep is obsolete; use #peek instead" if $VERBOSE
+    warn "StringScanner#peep is obsolete; use #peek instead" if $VERBOSE
     peek(length)
   end
   

Modified: MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb	2009-07-27 03:49:59 UTC (rev 2092)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb	2009-07-27 04:19:12 UTC (rev 2093)
@@ -6,24 +6,20 @@
   it_behaves_like(:strscan_matched_size, :matchedsize)
 
   it "warns in verbose mode that the method is obsolete" do
-    if Kernel.respond_to?(:warn)
-      s = StringScanner.new("abc")
-      begin
-        old = $VERBOSE
-        lambda {
-          $VERBOSE = true
-          s.matchedsize
-        }.should complain(/matchedsize.*obsolete.*matched_size/)
+    s = StringScanner.new("abc")
+    begin
+      old = $VERBOSE
+      lambda {
+        $VERBOSE = true
+        s.matchedsize
+      }.should complain(/matchedsize.*obsolete.*matched_size/)
 
-        lambda {
-          $VERBOSE = false
-          s.matchedsize
-        }.should_not complain
-      ensure
-        $VERBOSE = old
-      end
-    else
-      fail "The tested implementation cannot display warnings."
-    end
+      lambda {
+        $VERBOSE = false
+        s.matchedsize
+      }.should_not complain
+    ensure
+      $VERBOSE = old
+    end 
   end
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090726/ab6593a6/attachment-0001.html>


More information about the macruby-changes mailing list