Sha256: ae9fd5713afe681cc94ab7e7d9d923df22334c1ba68e8e087f0332acda434e5a

Contents?: true

Size: 1.22 KB

Versions: 14

Compression:

Stored size: 1.22 KB

Contents

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

describe Attachable do
  
  before(:each) do
    @attachable = test_class_with(Attachable).new stub(:window)
  end
  
  describe "move_relative" do
    before(:each) do
      @attachable.stub! :position= => nil, :rotation= => nil
      
      @pod = stub :pod, :relative_position => :relative_position, :rotation => :some_rotation
    end
    it "should set the position to the pod's position plus the relative position" do
      @attachable.should_receive(:position=).once.with :relative_position
      
      @attachable.move_relative @pod
    end
    it "should set the rotation to the pod's rotation" do
      @attachable.should_receive(:rotation=).once.with :some_rotation
      
      @attachable.move_relative @pod
    end
  end
  
  describe "relative_position" do
    it "should be a writer" do
      lambda { @attachable.relative_position = :some_position }.should_not raise_error
    end
    it "should have a reader" do
      lambda { @attachable.relative_position }.should_not raise_error
    end
    it "should read what is written" do
      @attachable.relative_position = :some_position
      @attachable.relative_position.should == :some_position
    end
  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
gosu_extensions-0.2.9 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.8 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.7 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.6 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.5 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.4 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.3 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.2 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.1 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.2.0 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.1.28 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.1.27 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.1.26 spec/lib/traits/attachable_spec.rb
gosu_extensions-0.1.25 spec/lib/traits/attachable_spec.rb