/test/gosu_spec.rb
http://jgosu.googlecode.com/ · Ruby · 20 lines · 16 code · 4 blank · 0 comment · 1 complexity · a779849dcd76fac29dd0d4a23c020a2d MD5 · raw file
- $: << File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
- require 'rubygems'
- require 'gosu'
- include Gosu
- describe "Gosu free functions" do
- it "should include the milliseconds method that returns a fixnum" do
- milliseconds.should be_a_kind_of(Integer)
- end
- it "should include the distance method that returns the distance between two points" do
- distance(10.5, 23.2, -40.8, 0).should be_close(56.3, 0.005)
- end
- it "should include the offset_x and offset_y methods that return the x or y component offset for a radius and an angle" do
- offset_x(35, 200).should be_close(114.715, 0.005)
- offset_y(35, 200).should be_close(-163.83, 0.005)
- end
- end