Sha256: eeefc23df94f44fe5369f4bb7b9c414ad6b208cc5ed7ccfc8b565d77177429e2

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

$:.unshift(File.dirname(__FILE__) + "/../lib/")
require 'riot'
Riot.verbose

Riot.dots if ENV["TM_MODE"]

module Riot
  module AssertionTestContextMacros

    def assertion_test_passes(description, success_message="", &block)
      context(description) do
        setup(&block)
        setup { topic.run(Riot::Situation.new) }
        asserts("pass") { topic.first }.equals(:pass)
        asserts("success message") { topic.last }.equals(success_message)
      end
    end

    def assertion_test_fails(description, failure_message, &block)
      context(description) do
        setup(&block)
        asserts("failure") { topic.run(Riot::Situation.new).first }.equals(:fail)
        asserts("failure message") { topic.run(Riot::Situation.new).last }.equals(failure_message)
      end
    end

  end # AssertionTestContextMacros
end # Riot

Riot::Context.instance_eval { include Riot::AssertionTestContextMacros }

class MockReporter < Riot::Reporter
  def pass(description, message); end
  def fail(description, message); end
  def error(description, e); end
  def results; end
end

class ColorHelper
  require 'rubygems'
  require 'term/ansicolor'
  extend Term::ANSIColor
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
riot-0.10.12.pre test/teststrap.rb