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-0.10.9 spec/osx/deferred_spec.rb
motion-kit-0.10.8 spec/osx/deferred_spec.rb
motion-kit-0.10.7 spec/osx/deferred_spec.rb
motion-kit-0.10.6 spec/osx/deferred_spec.rb
motion-kit-0.10.5 spec/osx/deferred_spec.rb
motion-kit-0.10.4 spec/osx/deferred_spec.rb
motion-kit-0.10.3 spec/osx/deferred_spec.rb
motion-kit-0.10.2 spec/osx/deferred_spec.rb
motion-kit-0.10.1 spec/osx/deferred_spec.rb
motion-kit-0.10.0 spec/osx/deferred_spec.rb
motion-kit-0.9.6 spec/osx/deferred_spec.rb
motion-kit-0.9.4 spec/osx/deferred_spec.rb
motion-kit-0.9.3 spec/osx/deferred_spec.rb
motion-kit-0.9.2 spec/osx/deferred_spec.rb
motion-kit-0.9.1 spec/osx/deferred_spec.rb
motion-kit-0.9.0 spec/osx/deferred_spec.rb