1 require File.dirname(__FILE__) + '/../../spec_helper'
5 it "returns true when the passed Object is a Set and self and the Object contain the same elements" do
7 Set[1, 2, 3].should == Set[1, 2, 3]
8 Set["1", "2", "3"].should == Set["1", "2", "3"]
10 Set[1, 2, 3].should_not == Set[1.0, 2, 3]
11 Set[1, 2, 3].should_not == [1, 2, 3]
14 it "does not depend on the order of the elements" do
15 Set[1, 2, 3].should == Set[3, 2, 1]
16 Set[:a, "b", ?c].should == Set[?c, "b", :a]
19 ruby_version_is "" ... "1.8.7" do
20 it "does depend on the order of nested Sets" do
21 Set[Set[1], Set[2], Set[3]].should_not == Set[Set[3], Set[2], Set[1]]
23 set1 = Set[Set["a", "b"], Set["c", "d"], Set["e", "f"]]
24 set2 = Set[Set["c", "d"], Set["a", "b"], Set["e", "f"]]
25 set1.should_not == set2
29 ruby_version_is "1.8.7" do
30 it "does not depend on the order of nested Sets" do
31 Set[Set[1], Set[2], Set[3]].should == Set[Set[3], Set[2], Set[1]]
33 set1 = Set[Set["a", "b"], Set["c", "d"], Set["e", "f"]]
34 set2 = Set[Set["c", "d"], Set["a", "b"], Set["e", "f"]]