/test/gosu_spec.rb

http://jgosu.googlecode.com/ · Ruby · 20 lines · 16 code · 4 blank · 0 comment · 1 complexity · a779849dcd76fac29dd0d4a23c020a2d MD5 · raw file

  1. $: << File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
  2. require 'rubygems'
  3. require 'gosu'
  4. include Gosu
  5. describe "Gosu free functions" do
  6. it "should include the milliseconds method that returns a fixnum" do
  7. milliseconds.should be_a_kind_of(Integer)
  8. end
  9. it "should include the distance method that returns the distance between two points" do
  10. distance(10.5, 23.2, -40.8, 0).should be_close(56.3, 0.005)
  11. end
  12. 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
  13. offset_x(35, 200).should be_close(114.715, 0.005)
  14. offset_y(35, 200).should be_close(-163.83, 0.005)
  15. end
  16. end