[macruby-changes] [1342] MacRuby/branches/experimental/spec/frozen/core/hash/ element_reference_spec.rb

source_changes at macosforge.org source_changes at macosforge.org
Sat Apr 4 08:24:30 PDT 2009


Revision: 1342
          http://trac.macosforge.org/projects/ruby/changeset/1342
Author:   eloy.de.enige at gmail.com
Date:     2009-04-04 08:24:30 -0700 (Sat, 04 Apr 2009)
Log Message:
-----------
Move Hash.[] specs to constructor.rb

Modified Paths:
--------------
    MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb

Modified: MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb	2009-04-04 15:24:21 UTC (rev 1341)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb	2009-04-04 15:24:30 UTC (rev 1342)
@@ -1,38 +1,6 @@
 require File.dirname(__FILE__) + '/../../spec_helper'
 require File.dirname(__FILE__) + '/fixtures/classes'
 
-describe "Hash.[]" do
-  it "creates a Hash; values can be provided as the argument list" do
-    Hash[:a, 1, :b, 2].should == {:a => 1, :b => 2}
-    Hash[].should == {}
-    Hash[:a, 1, :b, {:c => 2}].should == {:a => 1, :b => {:c => 2}}
-  end
-
-  it "creates a Hash; values can be provided as one single hash" do
-    Hash[:a => 1, :b => 2].should == {:a => 1, :b => 2}
-    Hash[{1 => 2, 3 => 4}].should == {1 => 2, 3 => 4}
-    Hash[{}].should == {}
-  end
-
-  it "raises an ArgumentError when passed an odd number of arguments" do
-    lambda { Hash[1, 2, 3] }.should raise_error(ArgumentError)
-    lambda { Hash[1, 2, {3 => 4}] }.should raise_error(ArgumentError)
-  end
-
-  ruby_bug "#", "1.8.6" do
-    it "call to_hash" do
-      obj = mock('x')
-      def obj.to_hash() { 1 => 2, 3 => 4 } end
-      Hash[obj].should == { 1 => 2, 3 => 4 }
-    end
-  end
-
-  it "returns an instance of the class it's called on" do
-    Hash[MyHash[1, 2]].class.should == Hash
-    MyHash[Hash[1, 2]].class.should == MyHash
-  end
-end
-
 describe "Hash#[]" do
   it "returns the value for key" do
     obj = mock('x')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090404/d4ab51ab/attachment-0001.html>


More information about the macruby-changes mailing list