Skip to content

Commit 136a6ab

Browse files
Syed Aslameregon
Syed Aslam
authored andcommitted
remove shared/join
1 parent 58e7652 commit 136a6ab

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

Diff for: library/set/join_spec.rb

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require_relative '../../spec_helper'
2-
require_relative 'shared/join'
32
require 'set'
43

54
ruby_version_is "3.0" do
@@ -8,6 +7,25 @@
87
Set[].join.should == ''
98
end
109

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
1230
end
1331
end

Diff for: library/set/shared/join.rb

-25
This file was deleted.

0 commit comments

Comments
 (0)