[macruby-changes] [1742] MacRuby/branches/experimental/spec/frozen
source_changes at macosforge.org
source_changes at macosforge.org
Thu Jun 4 18:25:36 PDT 2009
Revision: 1742
http://trac.macosforge.org/projects/ruby/changeset/1742
Author: lsansonetti at apple.com
Date: 2009-06-04 18:25:36 -0700 (Thu, 04 Jun 2009)
Log Message:
-----------
ditto for downcase
Added Paths:
-----------
MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/string/downcase_tags.txt
Removed Paths:
-------------
MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec_disabled.rb
Copied: MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb (from rev 1729, MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec_disabled.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb 2009-06-05 01:25:36 UTC (rev 1742)
@@ -0,0 +1,60 @@
+# -*- encoding: utf-8 -*-
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#downcase" do
+ it "returns a copy of self with all uppercase letters downcased" do
+ "hELLO".downcase.should == "hello"
+ "hello".downcase.should == "hello"
+ end
+
+ it "is locale insensitive (only replaces A-Z)" do
+ "ÄÖÜ".downcase.should == "ÄÖÜ"
+
+ str = Array.new(256) { |c| c.chr }.join
+ expected = Array.new(256) do |i|
+ c = i.chr
+ c.between?("A", "Z") ? c.downcase : c
+ end.join
+
+ str.downcase.should == expected
+ end
+
+ it "taints result when self is tainted" do
+ "".taint.downcase.tainted?.should == true
+ "x".taint.downcase.tainted?.should == true
+ "X".taint.downcase.tainted?.should == true
+ end
+
+ it "returns a subclass instance for subclasses" do
+ StringSpecs::MyString.new("FOObar").downcase.class.should == StringSpecs::MyString
+ end
+end
+
+describe "String#downcase!" do
+ it "modifies self in place" do
+ a = "HeLlO"
+ a.downcase!.should equal(a)
+ a.should == "hello"
+ end
+
+ it "returns nil if no modifications were made" do
+ a = "hello"
+ a.downcase!.should == nil
+ a.should == "hello"
+ end
+
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError when self is frozen" do
+ lambda { "HeLlo".freeze.downcase! }.should raise_error(TypeError)
+ lambda { "hello".freeze.downcase! }.should raise_error(TypeError)
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError when self is frozen" do
+ lambda { "HeLlo".freeze.downcase! }.should raise_error(RuntimeError)
+ lambda { "hello".freeze.downcase! }.should raise_error(RuntimeError)
+ end
+ end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec_disabled.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec_disabled.rb 2009-06-05 01:22:32 UTC (rev 1741)
+++ MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec_disabled.rb 2009-06-05 01:25:36 UTC (rev 1742)
@@ -1,60 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-
-describe "String#downcase" do
- it "returns a copy of self with all uppercase letters downcased" do
- "hELLO".downcase.should == "hello"
- "hello".downcase.should == "hello"
- end
-
- it "is locale insensitive (only replaces A-Z)" do
- "ÄÖÜ".downcase.should == "ÄÖÜ"
-
- str = Array.new(256) { |c| c.chr }.join
- expected = Array.new(256) do |i|
- c = i.chr
- c.between?("A", "Z") ? c.downcase : c
- end.join
-
- str.downcase.should == expected
- end
-
- it "taints result when self is tainted" do
- "".taint.downcase.tainted?.should == true
- "x".taint.downcase.tainted?.should == true
- "X".taint.downcase.tainted?.should == true
- end
-
- it "returns a subclass instance for subclasses" do
- StringSpecs::MyString.new("FOObar").downcase.class.should == StringSpecs::MyString
- end
-end
-
-describe "String#downcase!" do
- it "modifies self in place" do
- a = "HeLlO"
- a.downcase!.should equal(a)
- a.should == "hello"
- end
-
- it "returns nil if no modifications were made" do
- a = "hello"
- a.downcase!.should == nil
- a.should == "hello"
- end
-
- ruby_version_is ""..."1.9" do
- it "raises a TypeError when self is frozen" do
- lambda { "HeLlo".freeze.downcase! }.should raise_error(TypeError)
- lambda { "hello".freeze.downcase! }.should raise_error(TypeError)
- end
- end
-
- ruby_version_is "1.9" do
- it "raises a RuntimeError when self is frozen" do
- lambda { "HeLlo".freeze.downcase! }.should raise_error(RuntimeError)
- lambda { "hello".freeze.downcase! }.should raise_error(RuntimeError)
- end
- end
-end
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/string/downcase_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/string/downcase_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/string/downcase_tags.txt 2009-06-05 01:25:36 UTC (rev 1742)
@@ -0,0 +1,2 @@
+fails:String#downcase is locale insensitive (only replaces A-Z)
+fails:String#downcase returns a subclass instance for subclasses
Property changes on: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/string/downcase_tags.txt
___________________________________________________________________
Added: svn:eol-style
+ native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090604/b9ed86ca/attachment.html>
More information about the macruby-changes
mailing list