Module: Spreewald::Compatibility

Defined in:
lib/spreewald_support/compatibility.rb

Class Method Summary collapse

Class Method Details

.spreewald_failure_message(context, &block) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/spreewald_support/compatibility.rb', line 4

def self.spreewald_failure_message(context, &block)
  if context.respond_to?(:failure_message)
    context.failure_message(&block)
  else
    context.failure_message_for_should(&block)
  end
end

.spreewald_failure_message_negated(context, &block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/spreewald_support/compatibility.rb', line 12

def self.spreewald_failure_message_negated(context, &block)
  if context.respond_to?(:failure_message_when_negated)
    context.failure_message_when_negated(&block)
  else
    context.failure_message_for_should_not(&block)
  end
end