Sha256: d289678419222f13e5ff564a5e534ce7b6224575781eba306b800108a75fd85b

Contents?: true

Size: 581 Bytes

Versions: 22

Compression:

Stored size: 581 Bytes

Contents

require 'spec_helper'

describe Vector2 do
  describe "#initialize" do
    def check(object)
      vector = Vector2.new(object)
      vector.x.should == 1
      vector.y.should == -2
    end

    it "should parse strings containing 2 integers" do
      check '1 -2'
      check '+1x-2'
      check '1,-2'
      check '+1-2'
      check '1  -2'
    end

    it "should interpret a 2-element array of integers as x- and y- values" do
      check [1, -2]
    end

    it "should interpret a 2-element array of strings as x- and y- values" do
      check ['1', '-2']
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bulldog-0.2.4 spec/unit/vector2_spec.rb
bulldog-0.2.3 spec/unit/vector2_spec.rb
bulldog-0.2.2 spec/unit/vector2_spec.rb
bulldog-0.2.1 spec/unit/vector2_spec.rb
bulldog-0.2.0 spec/unit/vector2_spec.rb
bulldog-0.1.1 spec/unit/vector2_spec.rb
bulldog-0.1.0 spec/unit/vector2_spec.rb
bulldog-0.0.15 spec/unit/vector2_spec.rb
bulldog-0.0.14 spec/unit/vector2_spec.rb
bulldog-0.0.13 spec/unit/vector2_spec.rb
bulldog-0.0.12 spec/unit/vector2_spec.rb
bulldog-0.0.11 spec/unit/vector2_spec.rb
bulldog-0.0.10 spec/unit/vector2_spec.rb
bulldog-0.0.9 spec/unit/vector2_spec.rb
bulldog-0.0.8 spec/unit/vector2_spec.rb
bulldog-0.0.7 spec/unit/vector2_spec.rb
bulldog-0.0.6 spec/unit/vector2_spec.rb
bulldog-0.0.5 spec/unit/vector2_spec.rb
bulldog-0.0.3 spec/unit/vector2_spec.rb
bulldog-0.0.4 spec/unit/vector2_spec.rb