Sha256: 46d1f798b347f5ae5dded621a4cd562c12bf044b6728c88be6809a751bb8473d

Contents?: true

Size: 949 Bytes

Versions: 13

Compression:

Stored size: 949 Bytes

Contents

share_as :DirectionShared do
  include Command
  it 'should have a to_command method' do
    @dir.respond_to?(:to_command).should == true
  end
  it 'should have an absolute? method' do
    @dir.respond_to?(:absolute?).should == true
  end
  it 'should have a command_code method' do
    @dir.respond_to?(:command_code).should == true
  end
  describe '#to_command' do
    it "should start with the command\'s command code" do
      @dir.to_command[0,1].should == @dir.command_code
    end
    it 'should only have one alphabetical command code' do
      @dir.to_command.match(/[A-Za-z]/).size.should == 1
    end
  end
  describe '#command_code' do
    it 'should start with a lower-case letter when not absolute' do
      rel_dir = create_relative
      rel_dir.command_code.should == command_code.downcase
    end
    it 'should start with a capital letter when absolute' do
      @dir.command_code.should == command_code.upcase
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
savage-1.1.7 spec/shared/direction.rb
savage-1.1.6 spec/shared/direction.rb
savage-1.1.5 spec/shared/direction.rb
savage-1.1.4 spec/shared/direction.rb
savage-1.1.3 spec/shared/direction.rb
savage-1.1.2 spec/shared/direction.rb
savage-1.1.1 spec/shared/direction.rb
savage-1.1.0 spec/shared/direction.rb
savage-1.0.3 spec/shared/direction.rb
savage-1.0.2 spec/shared/direction.rb
savage-1.0.1 spec/shared/direction.rb
savage-1.0.0 spec/shared/direction.rb
savage-0.2.0 spec/shared/direction.rb