Sha256: 0678cebdd2a761d64c22465e99551db89c900cf7ace93029db95d8f874ec09ca

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

require File.expand_path(File.dirname(__FILE__)) + '/helpers.rb'

context "a vertex" do
  setup { Ray::Vertex.new }

  asserts(:pos).equals Ray::Vector2[0, 0]
  asserts(:col).equals Ray::Color.white
  asserts(:tex).equals Ray::Vector2[0, 0]

  context "after changing pos" do
    hookup { topic.pos = [1, 2] }

    asserts(:pos).equals Ray::Vector2[1, 2]
    asserts(:col).equals Ray::Color.white
    asserts(:tex).equals Ray::Vector2[0, 0]
  end

  context "after changing col" do
    hookup { topic.col = Ray::Color.red }

    asserts(:pos).equals Ray::Vector2[0, 0]
    asserts(:col).equals Ray::Color.red
    asserts(:tex).equals Ray::Vector2[0, 0]
  end

  context "after changing tex" do
    hookup { topic.tex = [3, 4] }

    asserts(:pos).equals Ray::Vector2[0, 0]
    asserts(:col).equals Ray::Color.white
    asserts(:tex).equals Ray::Vector2[3, 4]
  end
end

context "a vertex created with settings" do
  setup { Ray::Vertex.new([1, 2], Ray::Color.green, [3, 4]) }

  asserts(:pos).equals Ray::Vector2[1, 2]
  asserts(:col).equals Ray::Color.green
  asserts(:tex).equals Ray::Vector2[3, 4]
end

run_tests if __FILE__ == $0

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ray-0.2.1 test/vertex_test.rb
ray-0.2.0 test/vertex_test.rb
ray-0.1.1 test/vertex_test.rb
ray-0.1.0 test/vertex_test.rb