diff options
Diffstat (limited to 'spec/ruby/library/set/sortedset/to_a_spec.rb')
-rw-r--r-- | spec/ruby/library/set/sortedset/to_a_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/ruby/library/set/sortedset/to_a_spec.rb b/spec/ruby/library/set/sortedset/to_a_spec.rb new file mode 100644 index 0000000000..ba37d18cdb --- /dev/null +++ b/spec/ruby/library/set/sortedset/to_a_spec.rb @@ -0,0 +1,17 @@ +require_relative '../../../spec_helper' +require 'set' + +describe "SortedSet#to_a" do + it "returns an array containing elements" do + set = SortedSet.new [1, 2, 3] + set.to_a.should == [1, 2, 3] + end + + it "returns a sorted array containing elements" do + set = SortedSet[2, 3, 1] + set.to_a.should == [1, 2, 3] + + set = SortedSet.new [5, 6, 4, 4] + set.to_a.should == [4, 5, 6] + end +end |