Sha256: 2482e168f5905228bdc2702a02231059e409332dfa1bbf0546fac3ae7bc930ab

Contents?: true

Size: 1007 Bytes

Versions: 18

Compression:

Stored size: 1007 Bytes

Contents

describe MotionKit::Layout do
  before do
    @subject = TestCreateLayout.new
  end

  it 'should create a view' do
    @subject.create_view.should.not == nil
  end

  it 'should create a UIView' do
    @subject.create_view.should.be.kind_of(UIView)
  end

  it 'should create a new view every time' do
    create_view1 = @subject.create_view
    create_view2 = @subject.create_view
    create_view1.should.not == create_view2
  end

  it 'should create a view without a superview' do
    @subject.create_view.superview.should == nil
  end

  it 'should add a label to the view' do
    @subject.create_view.subviews.first.should.be.kind_of(UILabel)
  end

  it 'should not add an image view' do
    @subject.create_view.subviews.find { |view| view.is_a?(UIImageView) }.should == nil
  end

  it 'should allow a view to be returned ' do
    @subject.create_and_context.should.not == nil
  end

  it 'should create a UIView via context' do
    @subject.create_and_context.should.be.kind_of(UIView)
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
motion-kit-0.10.11 spec/ios/create_layout_spec.rb
motion-kit-0.10.10 spec/ios/create_layout_spec.rb
motion-kit-0.10.9 spec/ios/create_layout_spec.rb
motion-kit-0.10.8 spec/ios/create_layout_spec.rb
motion-kit-0.10.7 spec/ios/create_layout_spec.rb
motion-kit-0.10.6 spec/ios/create_layout_spec.rb
motion-kit-0.10.5 spec/ios/create_layout_spec.rb
motion-kit-0.10.4 spec/ios/create_layout_spec.rb
motion-kit-0.10.3 spec/ios/create_layout_spec.rb
motion-kit-0.10.2 spec/ios/create_layout_spec.rb
motion-kit-0.10.1 spec/ios/create_layout_spec.rb
motion-kit-0.10.0 spec/ios/create_layout_spec.rb
motion-kit-0.9.6 spec/ios/create_layout_spec.rb
motion-kit-0.9.4 spec/ios/create_layout_spec.rb
motion-kit-0.9.3 spec/ios/create_layout_spec.rb
motion-kit-0.9.2 spec/ios/create_layout_spec.rb
motion-kit-0.9.1 spec/ios/create_layout_spec.rb
motion-kit-0.9.0 spec/ios/create_layout_spec.rb