PageRenderTime 29ms CodeModel.GetById 12ms app.highlight 13ms RepoModel.GetById 2ms app.codeStats 0ms

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