Sha256: 48ad906dc25ed4c76722e8207ba0e2d840416c55dee05765c0f147b9b2977ce8

Contents?: true

Size: 867 Bytes

Versions: 25

Compression:

Stored size: 867 Bytes

Contents

require_relative 'helper'


class TestShape < Test::Unit::TestCase

  def shape(*args, &block)
    Reflex::RectShape.new(*args, &block)
  end

  def test_density()
    s = shape
    assert_equal 0, s.density
    s.density = 1
    assert_equal 1, s.density
    s.density 2
    assert_equal 2, s.density
  end

  def test_friction()
    s = shape
    assert_equal 0, s.friction
    s.friction = 1
    assert_equal 1, s.friction
    s.friction 2
    assert_equal 2, s.friction
  end

  def test_restitution()
    s = shape
    assert_equal 0, s.restitution
    s.restitution = 1
    assert_equal 1, s.restitution
    s.restitution 2
    assert_equal 2, s.restitution
  end

  def test_sensor()
    s = shape
    assert_equal false, s.sensor?
    s.sensor = true
    assert_equal true, s.sensor?
    s.sensor false
    assert_equal false, s.sensor?
  end

end# TestShape

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
reflexion-0.3 test/test_shape.rb
reflexion-0.2.1 test/test_shape.rb
reflexion-0.2 test/test_shape.rb
reflexion-0.1.57 test/test_shape.rb
reflexion-0.1.56 test/test_shape.rb
reflexion-0.1.55 test/test_shape.rb
reflexion-0.1.54 test/test_shape.rb
reflexion-0.1.53 test/test_shape.rb
reflexion-0.1.52 test/test_shape.rb
reflexion-0.1.51 test/test_shape.rb
reflexion-0.1.50 test/test_shape.rb
reflexion-0.1.49 test/test_shape.rb
reflexion-0.1.48 test/test_shape.rb
reflexion-0.1.47 test/test_shape.rb
reflexion-0.1.46 test/test_shape.rb
reflexion-0.1.45 test/test_shape.rb
reflexion-0.1.44 test/test_shape.rb
reflexion-0.1.43 test/test_shape.rb
reflexion-0.1.42 test/test_shape.rb
reflexion-0.1.41 test/test_shape.rb