File tree 2 files changed +20
-27
lines changed
2 files changed +20
-27
lines changed Original file line number Diff line number Diff line change 1
1
require_relative '../../spec_helper'
2
- require_relative 'shared/join'
3
2
require 'set'
4
3
5
4
ruby_version_is "3.0" do
8
7
Set [ ] . join . should == ''
9
8
end
10
9
11
- it_behaves_like :set_join , :join
10
+ it "returns a new string formed by joining elements after conversion" do
11
+ set = Set [ :a , :b , :c ]
12
+ set . join . should == "abc"
13
+ end
14
+
15
+ it "does not separate elements when the passed separator is nil" do
16
+ set = Set [ :a , :b , :c ]
17
+ set . join ( nil ) . should == "abc"
18
+ end
19
+
20
+ it "returns a string formed by concatenating each element separated by the separator" do
21
+ set = Set [ :a , :b , :c ]
22
+ set . join ( ' | ' ) . should == "a | b | c"
23
+ end
24
+
25
+ it "calls #to_a to convert the Set in to an Array" do
26
+ set = Set [ :a , :b , :c ]
27
+ set . should_receive ( :to_a ) . and_return ( [ :a , :b , :c ] )
28
+ set . join . should == "abc"
29
+ end
12
30
end
13
31
end
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments