Sha256: 6046030f35c1976c8ab87524b424f22495b936951c6250ce3d694fab572de998

Contents?: true

Size: 748 Bytes

Versions: 9

Compression:

Stored size: 748 Bytes

Contents

require_relative 'helper'


class TestGraphicsContext < Test::Unit::TestCase

  P = Processing
  G = P::Graphics

  def graphics(w = 10, h = 10)
    G.new w, h
  end

  def test_colorMode()
    g = graphics
    assert_equal G::RGB, g.colorMode

    g.colorMode G::HSB, 1
    assert_equal G::HSB, g.colorMode

    assert_raise {g.colorMode LEFT}
  end

  def test_angleMode()
    g = graphics
    assert_equal G::RADIANS, g.angleMode

    g.angleMode G::DEGREES
    assert_equal G::DEGREES, g.angleMode

    assert_raise {g.angleMode LEFT}
  end

  def test_blendMode()
    g = graphics
    assert_equal G::BLEND, g.blendMode

    g.blendMode G::ADD
    assert_equal G::ADD, g.blendMode

    assert_raise {g.blendMode LEFT}
  end

end# TestGraphics

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
processing-0.5.16 test/test_graphics_context.rb
processing-0.5.14 test/test_graphics_context.rb
processing-0.5.13 test/test_graphics_context.rb
processing-0.5.12 test/test_graphics_context.rb
processing-0.5.11 test/test_graphics_context.rb
processing-0.5.10 test/test_graphics_context.rb
processing-0.5.9 test/test_graphics_context.rb
processing-0.5.8 test/test_graphics_context.rb
processing-0.5.6 test/test_graphics_context.rb