summaryrefslogtreecommitdiff
path: root/spec/mspec/lib/mspec/matchers/be_true.rb
blob: de8e237d3540d464ac3c0b99872b10bcfb492532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class BeTrueMatcher
  def matches?(actual)
    @actual = actual
    @actual == true
  end

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

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

class Object
  def be_true
    BeTrueMatcher.new
  end
end