lib/remarkable/messages.rb in remarkable-3.0.8 vs lib/remarkable/messages.rb in remarkable-3.0.9
- old
+ new
@@ -1,6 +1,9 @@
-module Remarkable
+module Remarkable
+ # Holds the methods required by rspec for each matcher plus a collection of
+ # helpers to deal with I18n.
+ #
module Messages
# Provides a default description message. Overwrite it if needed.
# By default it uses default i18n options, but without the subjects, which
# usually are not available when description is called.
@@ -75,13 +78,15 @@
Remarkable.t('remarkable.core.not', :default => 'not') + " "
end
# Converts an array to a sentence
#
- def array_to_sentence(array)
+ def array_to_sentence(array, inspect=false)
words_connector = Remarkable.t 'remarkable.core.helpers.words_connector'
two_words_connector = Remarkable.t 'remarkable.core.helpers.two_words_connector'
last_word_connector = Remarkable.t 'remarkable.core.helpers.last_word_connector'
+
+ array.map!{|i| i.inspect} if inspect
case array.length
when 0
''
when 1