Sha256: c2dd0e7d15d8aa4f4cd6630554b4505f1ad4a866f79eef60ef2a61dc26737ccc

Contents?: true

Size: 662 Bytes

Versions: 10

Compression:

Stored size: 662 Bytes

Contents

module Riot
  # Asserts that the result of the test is equivalent to the expected value. Using the +===+ operator.
  #
  #   asserts("test") { "foo" }.equivalent_to(String)
  #   should("test") { "foo" }.equivalent_to("foo")
  #   asserts("test") { "foo" }.equivalent_to { "foo" }
  #
  # Underneath the hood, this assertion macro says:
  #
  #   expected === actual
  class EquivalentToMacro < AssertionMacro
    register :equivalent_to

    def evaluate(actual, expected)
      if expected === actual
        pass new_message.is_equivalent_to(expected)
      else
        fail expected_message(actual).to_be_equivalent_to(expected)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
riot-0.11.4 lib/riot/assertion_macros/equivalent_to.rb
riot-0.11.4.pre lib/riot/assertion_macros/equivalent_to.rb
riot-0.11.3 lib/riot/assertion_macros/equivalent_to.rb
riot-0.11.2 lib/riot/assertion_macros/equivalent_to.rb
riot-0.11.1 lib/riot/assertion_macros/equivalent_to.rb
riot-0.11.0 lib/riot/assertion_macros/equivalent_to.rb
riot-0.10.13 lib/riot/assertion_macros/equivalent_to.rb
riot-0.10.13.pre lib/riot/assertion_macros/equivalent_to.rb
riot-0.10.12 lib/riot/assertion_macros/equivalent_to.rb
riot-0.10.12.pre lib/riot/assertion_macros/equivalent_to.rb