Sha256: b70b99742d7fc896828c957fef7c9d6a1d0da2867e3aa4cd650637e94090c770

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

require '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 & 1 rubygems

Version Path
shoes-swt-4.0.0.pre6 spec/shoes/swt/shell_control_listener_spec.rb
shoes-swt-4.0.0.pre5 spec/shoes/swt/shell_control_listener_spec.rb