File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ module StringSpecs
2
+ def self . squiggly_message
3
+ <<~HEREDOC
4
+ character density, n.:
5
+ The number of very weird people in the office.
6
+ HEREDOC
7
+ end
8
+ end
Original file line number Diff line number Diff line change 2
2
3
3
require File . expand_path ( '../../spec_helper' , __FILE__ )
4
4
5
+ ruby_version_is "2.3" do
6
+ require File . expand_path ( '../fixtures/squiggly_heredoc' , __FILE__ )
7
+ end
8
+
5
9
# TODO: rewrite these horrid specs. it "are..." seriously?!
6
10
7
11
describe "Ruby character strings" do
176
180
s . should == ' foo bar#{@ip}' + "\n "
177
181
end
178
182
183
+ ruby_version_is "2.3" do
184
+ it "allows HEREDOC with <<~'identifier', allowing to indent identifier and content" do
185
+ StringSpecs . squiggly_message . should == "character density, n.:\n The number of very weird people in the office.\n "
186
+ end
187
+ end
188
+
179
189
it "calls #to_s when the object is not a String" do
180
190
obj = mock ( 'to_s' )
181
191
obj . stub! ( :to_s ) . and_return ( '42' )
You can’t perform that action at this time.
0 commit comments