Sha256: 84a4cf16aef6310868079d2fd38f08d5c343ab45986843d615c3395322b64484

Contents?: true

Size: 816 Bytes

Versions: 12

Compression:

Stored size: 816 Bytes

Contents

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

describe Controllable do
  
  before(:each) do
    @window = stub :window
  end
  
  describe "add_controls_for" do
    before(:each) do
      @controllable_class = test_class_with Controllable do
        controls :a => :b, :c => :d
      end
    end
    it "should return the mapping" do
      @window.should_receive(:add_controls_for).once
      
      @controllable_class.new @window
    end
  end
  
  describe "controls_mapping" do
    before(:each) do
      @window.stub! :add_controls_for => nil
      @controllable = test_class_with Controllable do
        controls :a => :b, :c => :d
      end.new @window
    end
    it "should return the mapping" do
      @controllable.controls_mapping.should == { :a => :b, :c => :d }
    end
  end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gosu_extensions-0.2.4 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.2.3 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.2.2 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.2.1 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.2.0 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.1.28 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.1.27 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.1.26 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.1.25 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.1.24 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.1.23 spec/lib/traits/controllable_spec.rb
gosu_extensions-0.1.22 spec/lib/traits/controllable_spec.rb