Sha256: 4a72174f1edc9a4d25b8b77317841e2b417e40e2dc4457377967576b69b957c9

Contents?: true

Size: 995 Bytes

Versions: 13

Compression:

Stored size: 995 Bytes

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

require_relative './lib/wxframe_runner'

class DirectorExceptionTests < WxRuby::Test::GUITests

  class InvalidOutputSizer < Wx::BoxSizer

    def calc_min
      Wx::Point.new(1,1) # expects Wx::Size
    end

  end

  def test_invalid_output
    szr = InvalidOutputSizer.new(Wx::Orientation::VERTICAL)
    szr.add(Wx::Button.new(frame_win, name: 'button'), Wx::Direction::TOP)
    frame_win.sizer = szr
    assert_raise_kind_of(TypeError) { frame_win.layout }
    frame_win.sizer = nil
  end

  class ExceptionSizer < Wx::BoxSizer

    def calc_min
      raise RuntimeError, 'AnyThing'
    end

  end

  def test_exception_in_overload
    szr = ExceptionSizer.new(Wx::Orientation::VERTICAL)
    szr.add(Wx::Button.new(frame_win, name: 'button'), Wx::Direction::TOP)
    frame_win.sizer = szr
    assert_raise_kind_of(RuntimeError) { frame_win.layout }
    frame_win.sizer = nil
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wxruby3-1.2.1 tests/test_exceptions.rb
wxruby3-1.2.0 tests/test_exceptions.rb
wxruby3-1.1.2 tests/test_exceptions.rb
wxruby3-1.1.1 tests/test_exceptions.rb
wxruby3-1.1.0 tests/test_exceptions.rb
wxruby3-1.0.1 tests/test_exceptions.rb
wxruby3-0.9.8 tests/test_exceptions.rb
wxruby3-0.9.7 tests/test_exceptions.rb
wxruby3-0.9.5 tests/test_exceptions.rb
wxruby3-0.9.4 tests/test_exceptions.rb
wxruby3-0.9.3 tests/test_exceptions.rb
wxruby3-0.9.2 tests/test_exceptions.rb
wxruby3-0.9.1 tests/test_exceptions.rb