Sha256: 4abcd1f71fc6395c37a83e8bc86eb5464bf9f3c5c3002bc15b75c018c6c76bf5

Contents?: true

Size: 748 Bytes

Versions: 5

Compression:

Stored size: 748 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

5 entries across 5 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.beta.10-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.0.pre.beta.9-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.0.pre.beta.8-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.0.pre.beta.2-x64-mingw-ucrt-3.2-3.2.2 tests/testapp.rb
wxruby3-0.9.0.pre.beta.1-x64-mingw-ucrt-3.2 tests/testapp.rb