From 4e5bd49c913934a049769ab189ee91c0246c7fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Tue, 28 Jul 2015 23:05:52 -0500 Subject: [PATCH] Added back the method (and deprecated it) --- lib/cucumber/rb_support/rb_world.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/cucumber/rb_support/rb_world.rb b/lib/cucumber/rb_support/rb_world.rb index a28f826b97..5d0c91f074 100644 --- a/lib/cucumber/rb_support/rb_world.rb +++ b/lib/cucumber/rb_support/rb_world.rb @@ -65,6 +65,20 @@ def table(text_or_table, file=nil, line_offset=0) @__cucumber_runtime.table(text_or_table, file, line_offset) end + # Create an {Cucumber::Ast::DocString} object + # + # Useful in conjunction with the #step method, when + # want to specify a content type. + # @example Create a multiline string + # code = multiline_string(%{ + # puts "this is ruby code" + # %}, 'ruby') + def doc_string(string_without_triple_quotes, content_type='', line_offset=0) + STDERR.puts AnsiEscapes.failed + "WARNING: #doc_string is deprecated. Just pass a regular String instead:" + caller[0] + AnsiEscapes.reset + # TODO: rename this method to multiline_string + @__cucumber_runtime.doc_string(string_without_triple_quotes, content_type, line_offset) + end + # @deprecated Use {#puts} instead. def announce(*messages) STDERR.puts AnsiEscapes.failed + "WARNING: #announce is deprecated. Use #puts instead:" + caller[0] + AnsiEscapes.reset