Sha256: b75f737725bd6e012564b4bb278a23c1488839ec24052bba7a01bc3e17681df0

Contents?: true

Size: 546 Bytes

Versions: 2

Compression:

Stored size: 546 Bytes

Contents

module Riot
  # Asserts that the result of the test equals the expected value. Using the +===+ operator to assert
  # equality.
  #   asserts("test") { "foo" }.equals("foo")
  #   should("test") { "foo" }.equals("foo")
  #   asserts("test") { "foo" }.equals { "foo" }
  class EqualsMacro < AssertionMacro
    register :equals

    def evaluate(actual, expected)
      if expected === actual
        pass("is equal to #{expected.inspect}")
      else
        fail("expected #{expected.inspect}, not #{actual.inspect}")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
riot-0.10.11 lib/riot/assertion_macros/equals.rb
riot-0.10.10 lib/riot/assertion_macros/equals.rb