Sha256: 98a3935993a69418bff2d1635a74ebbeacd4cc55f2f54b82c471db5163ac63d4

Contents?: true

Size: 708 Bytes

Versions: 3

Compression:

Stored size: 708 Bytes

Contents

require 'test/unit'
require 'wx'

class TestingFrame < Wx::Frame
    def initialize
        super(nil, -1, '')
        evt_paint { on_paint }
    end

    def on_paint
        paint {}
        close
    end
end

class AppWithSimpleFrame < Wx::App
    attr_reader(:did_call_on_exit)

    def on_init
        TestingFrame.new.show
    end

    def on_exit
        @did_call_on_exit = true
        return 0
    end
end

class TestApp < Test::Unit::TestCase
  def test_self_closing_frame
    o = AppWithSimpleFrame.new
    o.run
    assert(o.did_call_on_exit, "didn't call on_exit?")
  end
end

if $0 == __FILE__
  require 'test/unit/ui/console/testrunner'
  Test::Unit::UI::Console::TestRunner.run(TestApp)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.beta.10 tests/testapp.rb
wxruby3-0.9.0.pre.beta.9 tests/testapp.rb
wxruby3-0.9.0.pre.beta.8 tests/testapp.rb