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-1.1.1 spec/tvos/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.1.1 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.1.0 spec/tvos/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.1.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.3 spec/tvos/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.3 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.2 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.2 spec/tvos/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.1 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.1 spec/tvos/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.0 spec/tvos/constraints_helpers/attribute_lookup_spec.rb
motion-kit-1.0.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.18.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.17.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.16.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.15.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.14.2 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.14.1 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.14.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb
motion-kit-0.13.0 spec/ios/constraints_helpers/attribute_lookup_spec.rb