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-0.12.0 spec/ios/setters_spec.rb
motion-kit-0.11.2 spec/ios/setters_spec.rb
motion-kit-0.11.1 spec/ios/setters_spec.rb
motion-kit-0.11.0 spec/ios/setters_spec.rb
motion-kit-0.10.11 spec/ios/setters_spec.rb
motion-kit-0.10.10 spec/ios/setters_spec.rb
motion-kit-0.10.9 spec/ios/setters_spec.rb
motion-kit-0.10.8 spec/ios/setters_spec.rb
motion-kit-0.10.7 spec/ios/setters_spec.rb
motion-kit-0.10.6 spec/ios/setters_spec.rb
motion-kit-0.10.5 spec/ios/setters_spec.rb
motion-kit-0.10.4 spec/ios/setters_spec.rb
motion-kit-0.10.3 spec/ios/setters_spec.rb
motion-kit-0.10.2 spec/ios/setters_spec.rb
motion-kit-0.10.1 spec/ios/setters_spec.rb
motion-kit-0.10.0 spec/ios/setters_spec.rb
motion-kit-0.9.6 spec/ios/setters_spec.rb
motion-kit-0.9.4 spec/ios/setters_spec.rb
motion-kit-0.9.3 spec/ios/setters_spec.rb
motion-kit-0.9.2 spec/ios/setters_spec.rb