rubinius/rubinius

View on GitHub
mspec/lib/mspec/matchers/be_empty.rb

Summary

Maintainability
A
0 mins
Test Coverage
class BeEmptyMatcher
  def matches?(actual)
    @actual = actual
    @actual.empty?
  end

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

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

class Object
  def be_empty
    BeEmptyMatcher.new
  end
end