Class: BeEmptyMatcher

Inherits:
Object show all
Defined in:
lib/extensions/mspec/mspec/matchers/be_empty.rb

Instance Method Summary collapse

Instance Method Details

#failure_messageObject



7
8
9
# File 'lib/extensions/mspec/mspec/matchers/be_empty.rb', line 7

def failure_message
  ["Expected #{@actual.inspect}", "to be empty"]
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
5
# File 'lib/extensions/mspec/mspec/matchers/be_empty.rb', line 2

def matches?(actual)
  @actual = actual
  @actual.empty?
end

#negative_failure_messageObject



11
12
13
# File 'lib/extensions/mspec/mspec/matchers/be_empty.rb', line 11

def negative_failure_message
  ["Expected #{@actual.inspect}", "not to be empty"]
end