Sha256: bccbe1677cf96f12ce2575b9536aec02a14252a0c3068d5ea93a05a6415b2851

Contents?: true

Size: 730 Bytes

Versions: 12

Compression:

Stored size: 730 Bytes

Contents

# -*- coding: utf-8 -*-


require_relative 'helper'


class TestContactEvent < Test::Unit::TestCase

  def event(*args)
    Reflex::ContactEvent.new(*args)
  end

  def shape()
    Reflex::RectShape.new
  end

  def view(*args)
    Reflex::View.new(*args)
  end

  def test_initialize()
    s, v    = shape, view
    v.shape = s# attach to view
    e       = event Reflex::ContactEvent::BEGIN, s
    assert_equal :begin, e.action
    assert_equal s,      e.shape
    assert_equal v,      e.view
  end

  def test_dup()
    e1 = event Reflex::ContactEvent::BEGIN, shape
    e2 = e1.dup
    e1.block
    e3 = e1.dup
    assert_true  e1.blocked?
    assert_false e2.blocked?
    assert_true  e3.blocked?
  end

end# TestContactEvent

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
reflexion-0.1.35 test/test_contact_event.rb
reflexion-0.1.34 test/test_contact_event.rb
reflexion-0.1.33 test/test_contact_event.rb
reflexion-0.1.32 test/test_contact_event.rb
reflexion-0.1.31 test/test_contact_event.rb
reflexion-0.1.30 test/test_contact_event.rb
reflexion-0.1.29 test/test_contact_event.rb
reflexion-0.1.28 test/test_contact_event.rb
reflexion-0.1.27 test/test_contact_event.rb
reflexion-0.1.26 test/test_contact_event.rb
reflexion-0.1.25 test/test_contact_event.rb
reflexion-0.1.24 test/test_contact_event.rb