Add monkey patch to fix cucumber docstrings:
Cucumber chomp the last \n from multiline strings (docstrings), this monkey patch modify Cucumber::Ast::DocString constructor to add the missing ending new line character and Cucumber::Formatter::Pretty#doc_string to remove it from the output.
This commit is contained in:
parent
9a726dc389
commit
929e82cd55
@ -14,3 +14,28 @@ module Cucumber
|
|||||||
end
|
end
|
||||||
|
|
||||||
require 'aruba/cucumber'
|
require 'aruba/cucumber'
|
||||||
|
|
||||||
|
|
||||||
|
require 'cucumber/formatter/pretty'
|
||||||
|
|
||||||
|
module Cucumber
|
||||||
|
module Ast
|
||||||
|
class DocString
|
||||||
|
alias :old_initialize :initialize
|
||||||
|
|
||||||
|
def initialize(string, content_type)
|
||||||
|
old_initialize(string + "\n", content_type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
module Formatter
|
||||||
|
class Pretty
|
||||||
|
alias :old_doc_string :doc_string
|
||||||
|
|
||||||
|
def doc_string(string)
|
||||||
|
old_doc_string(string.chomp)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user