lib/remarkable/dsl/matches.rb in remarkable-3.0.4 vs lib/remarkable/dsl/matches.rb in remarkable-3.0.5
- old
+ new
@@ -117,12 +117,17 @@
#
def send_methods_and_generate_message(methods) #:nodoc:
methods.each do |method|
bool, hash = send(method)
- unless bool
- @expectation ||= Remarkable.t "expectations.#{method.to_s.gsub(/(\?|\!)$/, '')}",
- default_i18n_options.merge(hash || {})
+ unless bool
+ parent_scope = matcher_i18n_scope.split('.')
+ matcher_name = parent_scope.pop
+ lookup = :"expectations.#{method.to_s.gsub(/(\?|\!)$/, '')}"
+
+ hash = { :scope => parent_scope, :default => lookup }.merge(hash || {})
+ @expectation ||= Remarkable.t "#{matcher_name}.#{lookup}", default_i18n_options.merge(hash)
+
return false
end
end
return true