[macruby-changes] [2269] MacRuby/trunk/spec/frozen/library/base64

source_changes at macosforge.org source_changes at macosforge.org
Sun Aug 9 15:15:36 PDT 2009


Revision: 2269
          http://trac.macosforge.org/projects/ruby/changeset/2269
Author:   eloy.de.enige at gmail.com
Date:     2009-08-09 15:15:34 -0700 (Sun, 09 Aug 2009)
Log Message:
-----------
Updated Base64 specs for 1.9. Patch by Dan Sinclair.

Modified Paths:
--------------
    MacRuby/trunk/spec/frozen/library/base64/b64encode_spec.rb
    MacRuby/trunk/spec/frozen/library/base64/decode_b_spec.rb

Modified: MacRuby/trunk/spec/frozen/library/base64/b64encode_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/base64/b64encode_spec.rb	2009-08-09 00:20:19 UTC (rev 2268)
+++ MacRuby/trunk/spec/frozen/library/base64/b64encode_spec.rb	2009-08-09 22:15:34 UTC (rev 2269)
@@ -2,33 +2,35 @@
 
 require 'base64'
 
-describe "Base64#b64encode" do
-  it "returns the Base64-encoded version of the given string with a newline at 60 characters" do
-    b64encoded_version = "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
-    lambda {
-      Base64.b64encode("Now is the time for all good coders to learn Ruby").should == b64encoded_version
-    }.should output
+ruby_version_is ""..."1.9" do 
+  describe "Base64#b64encode" do
+    it "returns the Base64-encoded version of the given string with a newline at 60 characters" do
+      b64encoded_version = "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
+      lambda {
+        Base64.b64encode("Now is the time for all good coders to learn Ruby").should == b64encoded_version
+      }.should output
+    end
+    
+    it "prints the Base64-encoded version of the given string with a newline after 60 characters" do
+      b64encoded_version ="Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
+      lambda {
+        Base64.b64encode("Now is the time for all good coders to learn Ruby")
+      }.should output(b64encoded_version)
+    end
   end
+
+  describe "Base64#b64encode with length" do
+    it "returns the Base64-encoded version of the given string with a newline at 60 characters" do
+      b64encoded_version = "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
+      lambda {
+        Base64.b64encode("Now is the time for all good coders to learn Ruby", 2).should == b64encoded_version
+      }.should output
+    end
   
-  it "prints the Base64-encoded version of the given string with a newline after 60 characters" do
-    b64encoded_version ="Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
-    lambda {
-      Base64.b64encode("Now is the time for all good coders to learn Ruby")
-    }.should output(b64encoded_version)
+    it "prints the Base64-encoded version of the given stringwith a newline after length characters" do
+      lambda {
+        Base64.b64encode("hello", 2).should == "aGVsbG8=\n" 
+      }.should output("aG\nVs\nbG\n8=\n")
+    end
   end
 end
-
-describe "Base64#b64encode with length" do
-  it "returns the Base64-encoded version of the given string with a newline at 60 characters" do
-    b64encoded_version = "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
-    lambda {
-      Base64.b64encode("Now is the time for all good coders to learn Ruby", 2).should == b64encoded_version
-    }.should output
-  end
-
-  it "prints the Base64-encoded version of the given stringwith a newline after length characters" do
-    lambda {
-      Base64.b64encode("hello", 2).should == "aGVsbG8=\n" 
-    }.should output("aG\nVs\nbG\n8=\n")
-  end
-end

Modified: MacRuby/trunk/spec/frozen/library/base64/decode_b_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/base64/decode_b_spec.rb	2009-08-09 00:20:19 UTC (rev 2268)
+++ MacRuby/trunk/spec/frozen/library/base64/decode_b_spec.rb	2009-08-09 22:15:34 UTC (rev 2269)
@@ -2,16 +2,18 @@
 
 require 'base64'
 
-describe "Base64#decode_b" do
-  it "supports an encoding type of base64 and the charachter set SHIFT_JIS" do
-    Base64.decode_b("=?SHIFT_JIS?B?Zm9v?=").should == 'foo'
+ruby_version_is ""..."1.9" do
+  describe "Base64#decode_b" do
+    it "supports an encoding type of base64 and the charachter set SHIFT_JIS" do
+      Base64.decode_b("=?SHIFT_JIS?B?Zm9v?=").should == 'foo'
+    end
+    
+    it "supports an encoding type of base64 and the character set ISO-2022-JP" do
+      Base64.decode_b("=?ISO-2022-JP?B?Zm9v?=").should == 'foo'
+    end
+    
+    # mSpec doesn't have pending specs yet
+    # Waiting on Kconv implementation
+    # it "decodes MIME encoded string and convert halfwidth katakana to fullwidth katakana."
   end
-  
-  it "supports an encoding type of base64 and the character set ISO-2022-JP" do
-    Base64.decode_b("=?ISO-2022-JP?B?Zm9v?=").should == 'foo'
-  end
-  
-  # mSpec doesn't have pending specs yet
-  # Waiting on Kconv implementation
-  # it "decodes MIME encoded string and convert halfwidth katakana to fullwidth katakana."
-end
\ No newline at end of file
+end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090809/3d730c5e/attachment.html>


More information about the macruby-changes mailing list