Sha256: badcc2b51f58d76c7d3b2d9037deb47c44c822374da1caaa781d3ce9871990e3

Contents?: true

Size: 485 Bytes

Versions: 39

Compression:

Stored size: 485 Bytes

Contents

require File.join(File.dirname(__FILE__), '/../../spec_helper')

describe Targetable do
  
  before(:each) do
    @targetable = Class.new do
      include Targetable
    end.new 
  end
  describe "distance_from" do
    before(:each) do
      @targetable.stub! :position => CP::Vec2.new(6, 8)
      @shooter = stub :shooter, :position => CP::Vec2.new(3, 4)
    end
    it "should return the right distance" do
      @targetable.distance_from(@shooter).should == 5.0
    end
  end
  
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
gosu_extensions-0.3.8 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.7 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.6 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.5 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.4 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.3 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.2 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.1 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.3.0 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.9 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.8 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.7 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.6 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.5 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.4 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.3 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.2 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.1 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.2.0 spec/lib/traits/targetable_spec.rb
gosu_extensions-0.1.28 spec/lib/traits/targetable_spec.rb