Sha256: e9aa0d48292fafc56a0510e37dbee29a0144c97ca8c86798751711a18898ff75

Contents?: true

Size: 966 Bytes

Versions: 42

Compression:

Stored size: 966 Bytes

Contents

describe 'Constraints - attribute lookup' do

  it 'should return NSLayoutAttributeLeft' do
    MotionKit::Constraint.attribute_lookup(:left).should == NSLayoutAttributeLeft
    MotionKit::Constraint.attribute_lookup(NSLayoutAttributeLeft).should == NSLayoutAttributeLeft
  end

  it 'should return NSLayoutAttributeWidth' do
    MotionKit::Constraint.attribute_lookup(:width).should == NSLayoutAttributeWidth
    MotionKit::Constraint.attribute_lookup(NSLayoutAttributeWidth).should == NSLayoutAttributeWidth
  end

  it 'should raise InvalidAttributeError' do
    -> do
      MotionKit::Constraint.attribute_lookup(:foo)
    end.should.raise(MotionKit::InvalidAttributeError)
  end

  it 'should reverse NSLayoutAttributeLeft' do
    MotionKit::Constraint.attribute_reverse(NSLayoutAttributeLeft).should == :left
  end

  it 'should reverse NSLayoutAttributeWidth' do
    MotionKit::Constraint.attribute_reverse(NSLayoutAttributeWidth).should == :width
  end

end

Version data entries

42 entries across 36 versions & 1 rubygems

Version Path
motion-kit-0.12.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.11.2 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.11.1 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.11.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.11 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.10 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.9 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.8 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.7 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.6 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.5 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.4 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.3 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.2 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.1 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.10.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.9.6 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.9.4 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.9.3 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.9.2 spec/ios/constraints_helpers/attribute_lookup_spec.rb