Sha256: a98ae5444d57806d58a6479a10e45cf317bbf15b10b91df0d4bf34d1a8cff94a

Contents?: true

Size: 1.9 KB

Versions: 36

Compression:

Stored size: 1.9 KB

Contents

describe TestDeferredLayout do

  before do
    @layout = TestDeferredLayout.new
    @layout.view
  end

  describe 'from layout' do
    it 'should run the deferred block' do
      @layout.layout_test_ran.should == true
    end

    it 'should have assigned the value 0' do
      @layout.layout_test_is_0.should == true
    end

    it 'should end up with the value 1' do
      @layout.layout_test.should == 1
    end
  end

  describe 'from create_view' do
    before do
      @layout.create_view
    end

    it 'should run the deferred block' do
      @layout.create_view_test_ran.should == true
    end

    it 'should have assigned the value 0' do
      @layout.create_view_test_is_0.should == true
    end

    it 'should end up with the value 1' do
      @layout.create_view_test.should == 1
    end
  end

  describe 'from error_no_context' do
    it 'should raise InvalidDeferredError' do
      -> do
        @layout.error_no_context
      end.should.raise(MK::InvalidDeferredError)
    end
  end

  describe 'from nested_blocks' do
    before do
      @layout.nested_blocks
    end

    it 'should run the deferred block' do
      @layout.nested_blocks_test_ran.should == true
    end
    it 'should have assigned the value 0' do
      @layout.nested_blocks_test_is_0.should == true
    end
    it 'should have assigned the value 1' do
      @layout.nested_blocks_test_is_1.should == true
    end
    it 'should end up with the value 1' do
      @layout.nested_blocks_test.should == 2
    end
  end

  describe 'from apply_layouts' do
    before do
      @layout.apply_layouts
    end

    it 'should run the deferred block' do
      @layout.apply_layouts_test_ran.should == 2
    end

    it 'should have assigned text to the label' do
      @layout.apply_layouts_label.stringValue.should == 'after'
    end

    it 'should have assigned opacity to the layer' do
      @layout.apply_layouts_layer.opacity.should == 0.5
    end
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
motion-kit-1.1.1 spec/osx/deferred_spec.rb
motion-kit-1.1.0 spec/osx/deferred_spec.rb
motion-kit-1.0.3 spec/osx/deferred_spec.rb
motion-kit-1.0.2 spec/osx/deferred_spec.rb
motion-kit-1.0.1 spec/osx/deferred_spec.rb
motion-kit-1.0.0 spec/osx/deferred_spec.rb
motion-kit-0.18.0 spec/osx/deferred_spec.rb
motion-kit-0.17.0 spec/osx/deferred_spec.rb
motion-kit-0.16.0 spec/osx/deferred_spec.rb
motion-kit-0.15.0 spec/osx/deferred_spec.rb
motion-kit-0.14.2 spec/osx/deferred_spec.rb
motion-kit-0.14.1 spec/osx/deferred_spec.rb
motion-kit-0.14.0 spec/osx/deferred_spec.rb
motion-kit-0.13.0 spec/osx/deferred_spec.rb
motion-kit-0.12.0 spec/osx/deferred_spec.rb
motion-kit-0.11.2 spec/osx/deferred_spec.rb
motion-kit-0.11.1 spec/osx/deferred_spec.rb
motion-kit-0.11.0 spec/osx/deferred_spec.rb
motion-kit-0.10.11 spec/osx/deferred_spec.rb
motion-kit-0.10.10 spec/osx/deferred_spec.rb