Sha256: 601b5770e67428cfb5eebde7bedf22d642c7258c47b5253bb57d1dec2a7c7268

Contents?: true

Size: 744 Bytes

Versions: 2

Compression:

Stored size: 744 Bytes

Contents

require 'swt_shoes/spec_helper'

describe Shoes::Swt::ShellControlListener do
  let(:app) {double 'SWT App', dsl: dsl_app, shell: shell, real: real}
  let(:shell) {double('Shell').as_null_object}
  let(:resize_callbacks) {[]}
  let(:dsl_app) {double('DSL App', resize_callbacks: resize_callbacks).as_null_object}
  let(:block) {double 'Block', call: nil}
  let(:resize_event) {double'resize_event', widget: shell}
  let(:real) {double('Swt Real').as_null_object}

  subject {Shoes::Swt::ShellControlListener.new(app)}
  before :each do
    subject.controlResized(resize_event)
  end
  
  describe 'resize' do
    let(:resize_callbacks ){[block]}
    it 'calls the resize block' do
      expect(block).to have_received(:call) 
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
shoes-swt-4.0.0.pre2 spec/swt_shoes/shell_control_listener_spec.rb
shoes-4.0.0.pre1 spec/swt_shoes/shell_control_listener_spec.rb