Sha256: 7d7ad6b037f1f969fd0465ef7fe498bbcc8e2e7a5cad78bf0a11ad1440e501aa

Contents?: true

Size: 1.04 KB

Versions: 42

Compression:

Stored size: 1.04 KB

Contents

describe 'Constraints - relationship lookup' do

  it 'should return NSLayoutRelationEqual' do
    MotionKit::Constraint.relationship_lookup(:equal).should == NSLayoutRelationEqual
    MotionKit::Constraint.relationship_lookup(NSLayoutRelationEqual).should == NSLayoutRelationEqual
  end

  it 'should return NSLayoutRelationGreaterThanOrEqual' do
    MotionKit::Constraint.relationship_lookup(:gte).should == NSLayoutRelationGreaterThanOrEqual
    MotionKit::Constraint.relationship_lookup(NSLayoutRelationGreaterThanOrEqual).should == NSLayoutRelationGreaterThanOrEqual
  end

  it 'should raise InvalidRelationshipError' do
    -> do
      MotionKit::Constraint.relationship_lookup(:foo)
    end.should.raise(MotionKit::InvalidRelationshipError)
  end

  it 'should reverse NSLayoutRelationEqual' do
    MotionKit::Constraint.relationship_reverse(NSLayoutRelationEqual).should == :equal
  end

  it 'should reverse NSLayoutRelationGreaterThanOrEqual' do
    MotionKit::Constraint.relationship_reverse(NSLayoutRelationGreaterThanOrEqual).should == :gte
  end

end

Version data entries

42 entries across 36 versions & 1 rubygems

Version Path
motion-kit-1.1.1 spec/tvos/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.1.1 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.1.0 spec/tvos/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.1.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.3 spec/tvos/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.3 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.2 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.2 spec/tvos/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.1 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.1 spec/tvos/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.0 spec/tvos/constraints_helpers/relationship_lookup_spec.rb
motion-kit-1.0.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.18.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.17.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.16.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.15.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.14.2 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.14.1 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.14.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb
motion-kit-0.13.0 spec/ios/constraints_helpers/relationship_lookup_spec.rb