File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ def ask(statement, *args)
77
77
# say("I know you knew that.")
78
78
#
79
79
def say ( message = "" , color = nil , force_new_line = ( message . to_s !~ /( |\t )\Z / ) )
80
- buffer = prepare_message ( message . to_s , *color )
81
- buffer << "\n " if force_new_line && !message . end_with? ( "\n " )
80
+ buffer = prepare_message ( message , *color )
81
+ buffer << "\n " if force_new_line && !message . to_s . end_with? ( "\n " )
82
82
83
83
stdout . print ( buffer )
84
84
stdout . flush
Original file line number Diff line number Diff line change @@ -119,6 +119,11 @@ def shell
119
119
expect ( $stdout) . to receive ( :print ) . with ( "Running..." )
120
120
shell . say ( "Running..." , nil , false )
121
121
end
122
+
123
+ it "coerces everything to a string before printing" do
124
+ expect ( $stdout) . to receive ( :print ) . with ( "this_is_not_a_string\n " )
125
+ shell . say ( :this_is_not_a_string , nil , true )
126
+ end
122
127
end
123
128
124
129
describe "#say_status" do
You can’t perform that action at this time.
0 commit comments