Sha256: 6c68c59464f641cde4972b4727f0250c868740b3f77c41153e8ae2bee9cc6cd0

Contents?: true

Size: 513 Bytes

Versions: 10

Compression:

Stored size: 513 Bytes

Contents

module Riot
  # Asserts that the result of the test is an object that responds to the given method
  #   asserts("test") { "foo" }.respond_to(:to_s)
  #   should("test") { "foo" }.respond_to(:to_s)
  class RespondToMacro < AssertionMacro
    register :respond_to
    register :responds_to

    def evaluate(actual, expected)
      if actual.respond_to?(expected)
        pass(new_message.responds_to(expected))
      else
        fail(expected_message.method(expected).is_not_defined)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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