test/helper.rb in processing-0.4.0 vs test/helper.rb in processing-0.5.0

- old
+ new

@@ -1,19 +1,25 @@ # -*- coding: utf-8 -*- %w[../xot ../rucy ../rays ../reflex .] - .map {|s| File.expand_path "../../#{s}/lib", __FILE__} + .map {|s| File.expand_path "../#{s}/lib", __dir__} .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)} require 'test/unit' require 'xot/test' -require 'processing' +require 'processing/all' include Xot::Test def assert_equal_vector(v1, v2, delta = 0.000001) assert_in_delta v1.x, v2.x, delta assert_in_delta v1.y, v2.y, delta assert_in_delta v1.z, v2.z, delta +end + +def graphics(width = 10, height = 10, &block) + Processing::Graphics.new(width, height).tap do |g| + g.beginDraw {block.call g, g.getInternal__} if block + end end