Sha256: b893e4cafdb0c6f5738bfbe13f5ec9bcf8c0b889f7c1521e2b3b94d4cd37a2b7

Contents?: true

Size: 1.48 KB

Versions: 42

Compression:

Stored size: 1.48 KB

Contents

describe "Layout setters" do

  describe "Pure ruby object" do

    before do
      @subject = TestSetters.new(TestSettersFixture.new)
    end

    it 'should set foo (setFoo)' do
      @subject.run_foo
      @subject.target.foo.should == 'foo'
    end

    it 'should set bar (bar=)' do
      @subject.run_bar
      @subject.target.bar.should == 'bar'
    end

    it 'should set setter (setter(val))' do
      @subject.run_setter
      @subject.target.setter.should == 'setter'
    end

    it 'should assign quux (baz.quux, attr_accessor) with baz as context' do
      @subject.run_baz
      @subject.target.baz.quux.should == 'quux'
    end

    it 'should assign quux (bazBaz.quux, attr_accessor) with baz_baz as context' do
      @subject.run_baz_baz
      @subject.target.bazBaz.quux.should == 'quux'
    end

  end

  describe "Objective-C object" do

    before do
      @subject = TestSetters.new(TestSettersLabel.new)
    end

    it 'should set text (setText)' do
      @subject.run_text
      @subject.target.text.should == 'text'
    end

    it 'should set bar (bar=)' do
      @subject.run_bar
      @subject.target.bar.should == 'bar'
    end

    it 'should set background_color (setBackgroundColor)' do
      @subject.run_background_color
      @subject.target.backgroundColor.should == UIColor.whiteColor
    end

    it 'should assign cornerRadius (layer.corner_radius) with layer as context' do
      @subject.run_layer(5)
      @subject.target.layer.cornerRadius.should == 5
    end
  end

end

Version data entries

42 entries across 36 versions & 1 rubygems

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